From 8f134fe4482a79b821a1922c209b46d867f738c1 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 31 Aug 2009 15:32:08 -0400 Subject: [PATCH] Remove references to the old Xen-SWIOTLB code. All references to the old pass-through SWIOTLB DMA ops for Dom0 are removed. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Jeremy Fitzhardinge --- arch/x86/kernel/pci-swiotlb.c | 5 --- arch/x86/xen/Makefile | 1 - drivers/pci/xen-iommu.c | 64 ----------------------------------- 3 files changed, 70 deletions(-) diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index 726737600ca..9640e17c69c 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c @@ -11,8 +11,6 @@ #include #include -#include - int swiotlb __read_mostly; static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, @@ -51,9 +49,6 @@ 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) { diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile index 8d7ed6b4948..172438f86a0 100644 --- a/arch/x86/xen/Makefile +++ b/arch/x86/xen/Makefile @@ -12,4 +12,3 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o -obj-$(CONFIG_PCI_XEN) += pci-swiotlb.o \ No newline at end of file diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c index b1a7d93d88c..5b7ef535588 100644 --- a/drivers/pci/xen-iommu.c +++ b/drivers/pci/xen-iommu.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -37,40 +36,6 @@ do { \ } while (0) -static int max_dma_bits = 32; - -void xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs) -{ - int i, rc; - int dma_bits; - - printk(KERN_DEBUG "xen_swiotlb_fixup: buf=%p size=%zu\n", - buf, size); - - dma_bits = get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT) + PAGE_SHIFT; - - i = 0; - do { - int slabs = min(nslabs - i, (unsigned long)IO_TLB_SEGSIZE); - - do { - rc = xen_create_contiguous_region( - (unsigned long)buf + (i << IO_TLB_SHIFT), - get_order(slabs << IO_TLB_SHIFT), - dma_bits); - } while (rc && dma_bits++ < max_dma_bits); - if (rc) - panic(KERN_ERR "xen_create_contiguous_region failed\n"); - - i += slabs; - } while(i < 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; @@ -290,30 +255,6 @@ static struct dma_map_ops xen_dma_ops = { .is_phys = 0, }; -static struct dma_map_ops xen_swiotlb_dma_ops = { - .dma_supported = swiotlb_dma_supported, - - .alloc_coherent = xen_alloc_coherent, - .free_coherent = xen_free_coherent, - - .map_page = swiotlb_map_page, - .unmap_page = swiotlb_unmap_page, - - .map_sg = swiotlb_map_sg_attrs, - .unmap_sg = swiotlb_unmap_sg_attrs, - - .mapping_error = swiotlb_dma_mapping_error, - - .sync_single_for_cpu = swiotlb_sync_single_for_cpu, - .sync_single_for_device = swiotlb_sync_single_for_device, - .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, - .sync_single_range_for_device = swiotlb_sync_single_range_for_device, - .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, - .sync_sg_for_device = swiotlb_sync_sg_for_device, - - .is_phys = 0, -}; - void __init xen_iommu_init(void) { if (!xen_pv_domain()) @@ -323,10 +264,5 @@ void __init xen_iommu_init(void) force_iommu = 0; dma_ops = &xen_dma_ops; - - if (swiotlb) { - printk(KERN_INFO "Xen: Enabling DMA fallback to swiotlb\n"); - dma_ops = &xen_swiotlb_dma_ops; - } } -- 2.39.5