]> xenbits.xensource.com Git - people/ssmith/netchannel2-pvops.git/commitdiff
xen: enable swiotlb for xen domain 0.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 9 Feb 2009 20:05:53 +0000 (12:05 -0800)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Fri, 26 Jun 2009 00:03:44 +0000 (17:03 -0700)
Enable swiotlb when running as a Xen dom0 domain.

[ Impact: enable swiotlb under Xen ]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/kernel/pci-swiotlb.c
arch/x86/xen/Kconfig
drivers/pci/xen-iommu.c
include/xen/swiotlb.h

index 9640e17c69c41270194f70ce61a92b615231ac9c..726737600ca23fcee3bdbfb45f549db084a2f998 100644 (file)
@@ -11,6 +11,8 @@
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
 
+#include <xen/swiotlb.h>
+
 int swiotlb __read_mostly;
 
 static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
@@ -49,6 +51,9 @@ void __init pci_swiotlb_init(void)
        if (!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)
               swiotlb = 1;
 #endif
+       if (xen_wants_swiotlb())
+               swiotlb = 1;
+
        if (swiotlb_force)
                swiotlb = 1;
        if (swiotlb) {
index 298170e18bbc6ffb3fb637cd9ebfc9ea86880144..c3ae47473f7173c0d8d238180918a3a1beeb514e 100644 (file)
@@ -6,6 +6,7 @@ config XEN
        bool "Xen guest support"
        select PARAVIRT
        select PARAVIRT_CLOCK
+       select SWIOTLB
        depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS)
        depends on X86_CMPXCHG && X86_TSC
        help
index be50f0f15909d75b9759b21a93a73f02b648d575..678a0e5d39594600a889c9162aef5305965a622f 100644 (file)
@@ -60,6 +60,11 @@ void xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
        }
 }
 
+int xen_wants_swiotlb(void)
+{
+       return xen_initial_domain();
+}
+
 dma_addr_t xen_phys_to_bus(phys_addr_t paddr)
 {
        return phys_to_machine(XPADDR(paddr)).maddr;
index 8b51ff74855d762b35f37aa67f346e455bdbf760..f35183b1bc1e515837fcce89d7788445c1009b9f 100644 (file)
@@ -5,5 +5,6 @@ extern void xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs);
 extern phys_addr_t xen_bus_to_phys(dma_addr_t daddr);
 extern dma_addr_t xen_phys_to_bus(phys_addr_t paddr);
 extern int xen_range_needs_mapping(phys_addr_t phys, size_t size);
+extern int xen_wants_swiotlb(void);
 
 #endif /* _XEN_SWIOTLB_H */