xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit
@ 2010-02-01 21:30 Ronny.Hegewald
  0 siblings, 0 replies; only message in thread
From: Ronny.Hegewald @ 2010-02-01 21:30 UTC (permalink / raw)
  To: xen-devel; +Cc: jeremy

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

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 dma_alloc_coherent_mask. 

The attached patch adds the same functionality to xen swiotlb.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>

--- 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);
        else
                mask = DMA_BIT_MASK(32);

[-- Attachment #2: swiotlb-32bit-range.patch --]
[-- Type: application/octet-stream, Size: 396 bytes --]

--- 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);
 	else
 		mask = DMA_BIT_MASK(32);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-01 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 21:30 [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit Ronny.Hegewald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).