]> xenbits.xensource.com Git - people/ssmith/netchannel2-pvops.git/commitdiff
xen/swiotlb: make sure GART iommu doesn't initialize if we want Xen swiotlb
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 23 Sep 2009 21:24:57 +0000 (17:24 -0400)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Wed, 23 Sep 2009 21:58:36 +0000 (14:58 -0700)
So the kernel sets the dma_ops to the Xen SWIOTLB, and it
allocates an extra 64MB chunk of memory for the GART, which is not
used, and ... somehow all of the ioremap_nocache functions stop working
correctly. Maybe the ioremap_nocache does use some of that memory that
the gart_iommu_hole_init allocated?

With this patch, the GART is forcefully disabled, and the kernel boots fine
(with 6GB, 8GB, etc).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
arch/x86/kernel/pci-dma.c
arch/x86/xen/pci-swiotlb.c

index e7ee2fdc02394b2a3859572f53ca63d63f358ffa..c7768a51161d7e4d770fcfac463ba5a96db4e077 100644 (file)
@@ -120,6 +120,8 @@ void __init pci_iommu_alloc(void)
         * The order of these functions is important for
         * fall-back/fail-over reasons
         */
+       xen_swiotlb_init();
+
        gart_iommu_hole_init();
 
        detect_calgary();
@@ -128,8 +130,6 @@ void __init pci_iommu_alloc(void)
 
        amd_iommu_detect();
 
-       xen_swiotlb_init();
-
        pci_swiotlb_init();
 }
 
index 5e2c85602863a4e7760eceda634875519e513886..00f2260a1b8a22caf24a63d218c5b7b372ec6f78 100644 (file)
 #include <xen/page.h>
 #include <xen/xen-ops.h>
 
+
+#include <linux/pci.h>
+#include <asm/gart.h>
+
 #define OFFSET(val,align) ((unsigned long)     \
                           ( (val) & ( (align) - 1)))
 
@@ -985,5 +989,9 @@ void __init xen_swiotlb_init(void)
                xen_swiotlb_init_with_default_size(64 * (1<<20));       /* default to 64MB */
                dma_ops = &xen_swiotlb_dma_ops;
                iommu_detected = 1;
+#ifdef CONFIG_GART_IOMMU
+               gart_iommu_aperture_disabled = 1;
+#endif
+
        }
 }