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

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

The attached patch adds the same functionality to Xen SWIOTLB.

Signed-off-by: Ronny Hegewald <>
Signed-off-by: Konrad Rzeszutek Wilk <>
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,

 \ /
  Last update: 2010-06-22 21:49    [from the cache]
©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site