xen-devel
[Xen-devel] [PATCH 14/27] xen: enable swiotlb for xen domain 0.
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
arch/x86/kernel/pci-swiotlb.c | 4 ++++
arch/x86/xen/Kconfig | 1 +
drivers/pci/xen-iommu.c | 5 +++++
include/xen/swiotlb.h | 2 ++
4 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
index 5826be8..6d3ba02 100644
--- a/arch/x86/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -94,6 +94,10 @@ void __init pci_swiotlb_init(void)
if (!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)
swiotlb = 1;
#endif
+#ifdef CONFIG_PCI_XEN
+ if (xen_wants_swiotlb())
+ swiotlb = 1;
+#endif
if (swiotlb_force)
swiotlb = 1;
if (swiotlb) {
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index 87c13db..2c85967 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -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
diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c
index 0995ddf..80bb7ed 100644
--- a/drivers/pci/xen-iommu.c
+++ b/drivers/pci/xen-iommu.c
@@ -67,6 +67,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;
diff --git a/include/xen/swiotlb.h b/include/xen/swiotlb.h
index e15caa8..defac5c 100644
--- a/include/xen/swiotlb.h
+++ b/include/xen/swiotlb.h
@@ -9,6 +9,8 @@ static inline void xen_swiotlb_fixup(void *buf, size_t size,
unsigned long nslab
}
#endif
+extern int xen_wants_swiotlb(void);
+
extern phys_addr_t xen_bus_to_phys(dma_addr_t daddr);
extern dma_addr_t xen_phys_to_bus(phys_addr_t paddr);
--
1.6.0.6
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 05/27] x86/PCI: Clean up pci_cache_line_size, (continued)
- [Xen-devel] [PATCH 12/27] xen: add hooks for mapping phys<->bus addresses in swiotlb, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 11/27] xen swiotlb: fixup swiotlb is chunks smaller than MAX_CONTIG_ORDER, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 16/27] swiotlb: use swiotlb_alloc_boot to allocate emergency pool, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 14/27] xen: enable swiotlb for xen domain 0.,
Jeremy Fitzhardinge <=
- [Xen-devel] [PATCH 17/27] xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent(), Jeremy Fitzhardinge
- [Xen-devel] [PATCH 07/27] Xen/x86/PCI: Add support for the Xen PCI subsytem, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 19/27] xen: set callout_map to make mtrr work, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 18/27] xen/swiotlb: add sync functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 15/27] xen/swiotlb: use dma_alloc_from_coherent to get device coherent memory, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 20/27] xen mtrr: Use specific cpu_has_foo macros instead of generic cpu_has(), Jeremy Fitzhardinge
- [Xen-devel] [PATCH 24/27] xen mtrr: Kill some unneccessary includes, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 25/27] x86: define arch_vm_get_page_prot to set _PAGE_IOMAP on VM_IO vmas, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 26/27] agp: use more dma-ops-like operations for agp memory, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 21/27] xen mtrr: Use generic_validate_add_page(), Jeremy Fitzhardinge
|
|
|