lkml.org 
[lkml]   [2012]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.
Date
If a PV guest is booted the native SWIOTLB should not be
turned on. It does not help us (we don't have any PCI devices)
and it eats 64MB of good memory. In the case of PV guests
with PCI devices we need the Xen-SWIOTLB one.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/xen/pci-swiotlb-xen.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index b6a5340..0d5a214 100644
--- a/arch/x86/xen/pci-swiotlb-xen.c
+++ b/arch/x86/xen/pci-swiotlb-xen.c
@@ -8,6 +8,11 @@
#include <xen/xen.h>
#include <asm/iommu_table.h>

+#ifdef CONFIG_X86_64
+#include <asm/iommu.h>
+#include <asm/dma.h>
+#endif
+
int xen_swiotlb __read_mostly;

static struct dma_map_ops xen_swiotlb_dma_ops = {
@@ -49,6 +54,13 @@ int __init pci_xen_swiotlb_detect(void)
* the 'swiotlb' flag is the only one turning it on. */
swiotlb = 0;

+#ifdef CONFIG_X86_64
+ /* pci_swiotlb_detect_4gb turns native SWIOTLB if no_iommu == 0
+ * (so no iommu=X command line over-writes). So disable the native
+ * SWIOTLB. */
+ if (max_pfn > MAX_DMA32_PFN)
+ no_iommu = 1;
+#endif
return xen_swiotlb;
}

--
1.7.7.6


\
 
 \ /
  Last update: 2012-07-31 16:42    [W:0.099 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site