X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fx86_64%2Fkernel%2Fpci-swiotlb.c;h=4e116201b801d42cdd432dfef95111869b037026;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=6a55f87ba97f917ed2814bc3c11c3f21a3ad096b;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/arch/x86_64/kernel/pci-swiotlb.c b/arch/x86_64/kernel/pci-swiotlb.c index 6a55f87ba..4e116201b 100644 --- a/arch/x86_64/kernel/pci-swiotlb.c +++ b/arch/x86_64/kernel/pci-swiotlb.c @@ -3,15 +3,19 @@ #include #include #include -#include +#include + #include #include #include +#ifndef CONFIG_XEN int swiotlb __read_mostly; EXPORT_SYMBOL(swiotlb); +#endif struct dma_mapping_ops swiotlb_dma_ops = { +#ifndef CONFIG_XEN .mapping_error = swiotlb_dma_mapping_error, .alloc_coherent = swiotlb_alloc_coherent, .free_coherent = swiotlb_free_coherent, @@ -26,10 +30,18 @@ struct dma_mapping_ops swiotlb_dma_ops = { .map_sg = swiotlb_map_sg, .unmap_sg = swiotlb_unmap_sg, .dma_supported = NULL, +#endif }; void pci_swiotlb_init(void) { +#ifdef CONFIG_XEN + swiotlb_init(); + if (swiotlb) { + printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); + dma_ops = &swiotlb_dma_ops; + } +#else /* don't initialize swiotlb if iommu=off (no_iommu=1) */ if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN) swiotlb = 1; @@ -40,4 +52,5 @@ void pci_swiotlb_init(void) swiotlb_init(); dma_ops = &swiotlb_dma_ops; } +#endif /* CONFIG_XEN */ }