lkml.org 
[lkml]   [2010]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/19] swiotlb-xen: Don't allocate DMA-memory beyond 4GB in 32-bit mode.
Date
From: Ronny.Hegewald@online.de <Ronny.Hegewald@online.de>

When running in 32-bit PV environment various drivers try to allocate
a coherent DMA memory and the Xen SWIOTLB would return memory beyond 4GB.

On bare-metal the coherent DMA-memory using the native SWIOTLB would
always allocate memory 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>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
lib/swiotlb-xen.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/swiotlb-xen.c b/lib/swiotlb-xen.c
index 89443e4..2ebfcbd 100644
--- a/lib/swiotlb-xen.c
+++ b/lib/swiotlb-xen.c
@@ -150,7 +150,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
ret = (void *)vstart;

if (hwdev && hwdev->coherent_dma_mask)
- dma_mask = hwdev->coherent_dma_mask;
+ dma_mask = dma_alloc_coherent_mask(hwdev, flags);

if (ret) {
if (xen_create_contiguous_region(vstart, order,
--
1.7.0.1


\
 
 \ /
  Last update: 2010-06-22 21:49    [from the cache]
©2003-2011 Jasper Spaans