From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ronny.Hegewald@online.de Subject: [PVOPS][PATCH] xen-swiotlb: don't allocate DMA-memory beyond 32-bit Date: Mon, 01 Feb 2010 22:30:11 +0100 Message-ID: <28767599.3850891265059811952.JavaMail.servlet@kundenserver> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_337621_3067699.1265059811904" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: jeremy@goop.org List-Id: xen-devel@lists.xenproject.org ------=_Part_337621_3067699.1265059811904 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 --- 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); ------=_Part_337621_3067699.1265059811904 Content-Type: application/octet-stream; name=swiotlb-32bit-range.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=swiotlb-32bit-range.patch --- 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); ------=_Part_337621_3067699.1265059811904 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_Part_337621_3067699.1265059811904--