[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit

When running 32-bit pvops-dom0 and a driver tries to allocate a coherent 
DMA-memory the xen swiotlb-implementation returned memory beyond 4GB.

This caused for example not working sound on a system with 4 GB and a 64-bit 
compatible sound-card with sets the DMA-mask to 64bit. 

On bare-metal and the forward-ported xen-dom0 patches from OpenSuse a coherent 
DMA-memory is always allocated inside the 32-bit address-range by calling 

The attached patch adds the same functionality to xen swiotlb.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@xxxxxxxxx>

--- arch/x86/xen/pci-swiotlb.c-org      2010-02-01 23:04:42.000000000 +0100
+++ arch/x86/xen/pci-swiotlb.c  2010-02-01 23:20:42.000000000 +0100
@@ -602,7 +602,7 @@ xen_swiotlb_alloc_coherent(struct device
        ret = (void *)vstart;

        if (hwdev != NULL && hwdev->coherent_dma_mask)
-               mask = hwdev->coherent_dma_mask;
+               mask = dma_alloc_coherent_mask(hwdev, flags);
                mask = DMA_BIT_MASK(32);

Attachment: swiotlb-32bit-range.patch
Description: Binary data

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.