This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit
From: Ronny.Hegewald@xxxxxxxxx
Date: Mon, 01 Feb 2010 22:30:11 +0100
Cc: jeremy@xxxxxxxx
Delivery-date: Mon, 01 Feb 2010 13:30:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit, Ronny . Hegewald <=