X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fx86_64%2Fkernel%2Fpci-swiotlb.c;h=4e116201b801d42cdd432dfef95111869b037026;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=990ed67896f2ff514cc6283a65fea24fa00adcf1;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/arch/x86_64/kernel/pci-swiotlb.c b/arch/x86_64/kernel/pci-swiotlb.c index 990ed6789..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,17 +30,27 @@ 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_aperture && !no_iommu && - (end_pfn > MAX_DMA32_PFN || force_iommu)) + if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN) swiotlb = 1; + if (swiotlb_force) + swiotlb = 1; if (swiotlb) { printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); swiotlb_init(); dma_ops = &swiotlb_dma_ops; } +#endif /* CONFIG_XEN */ }