ia64/xen-unstable

changeset 8826:1d36cca98fc3

Avoid misleading message about 'not using swiotlb' on x86/64
domain0. Provide a temporary glue between our swiotlb
implementation and x86/64's dma_ops dynamic dma-mapping
infrastructure.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Feb 10 12:35:19 2006 +0100 (2006-02-10)
parents 47013962e411
children dfdb9cfc8b79 260a09e9a9c1
files linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile linux-2.6-xen-sparse/arch/x86_64/kernel/pci-swiotlb-xen.c linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile	Fri Feb 10 03:23:36 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile	Fri Feb 10 12:35:19 2006 +0100
     1.3 @@ -59,7 +59,7 @@ pci-dma-y			+= ../../i386/kernel/pci-dma
     1.4  microcode-$(subst m,y,$(CONFIG_MICROCODE))  := ../../i386/kernel/microcode-xen.o
     1.5  quirks-y			:= ../../i386/kernel/quirks-xen.o
     1.6  
     1.7 -n-obj-xen := i8259.o reboot.o i8237.o smpboot.o trampoline.o pci-swiotlb.o
     1.8 +n-obj-xen := i8259.o reboot.o i8237.o smpboot.o trampoline.o
     1.9  
    1.10  include $(srctree)/scripts/Makefile.xen
    1.11  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/pci-swiotlb-xen.c	Fri Feb 10 12:35:19 2006 +0100
     2.3 @@ -0,0 +1,54 @@
     2.4 +/* Glue code to lib/swiotlb.c */
     2.5 +
     2.6 +#include <linux/pci.h>
     2.7 +#include <linux/cache.h>
     2.8 +#include <linux/module.h>
     2.9 +#include <asm/dma-mapping.h>
    2.10 +#include <asm/proto.h>
    2.11 +#include <asm/swiotlb.h>
    2.12 +#include <asm/dma.h>
    2.13 +
    2.14 +#if 0
    2.15 +int swiotlb __read_mostly;
    2.16 +EXPORT_SYMBOL(swiotlb);
    2.17 +#endif
    2.18 +
    2.19 +struct dma_mapping_ops swiotlb_dma_ops = {
    2.20 +#if 0
    2.21 +	.mapping_error = swiotlb_dma_mapping_error,
    2.22 +	.alloc_coherent = swiotlb_alloc_coherent,
    2.23 +	.free_coherent = swiotlb_free_coherent,
    2.24 +	.map_single = swiotlb_map_single,
    2.25 +	.unmap_single = swiotlb_unmap_single,
    2.26 +	.sync_single_for_cpu = swiotlb_sync_single_for_cpu,
    2.27 +	.sync_single_for_device = swiotlb_sync_single_for_device,
    2.28 +	.sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
    2.29 +	.sync_single_range_for_device = swiotlb_sync_single_range_for_device,
    2.30 +	.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
    2.31 +	.sync_sg_for_device = swiotlb_sync_sg_for_device,
    2.32 +	.map_sg = swiotlb_map_sg,
    2.33 +	.unmap_sg = swiotlb_unmap_sg,
    2.34 +	.dma_supported = NULL,
    2.35 +#endif
    2.36 +};
    2.37 +
    2.38 +void pci_swiotlb_init(void)
    2.39 +{
    2.40 +#if 0
    2.41 +	/* don't initialize swiotlb if iommu=off (no_iommu=1) */
    2.42 +	if (!iommu_aperture && !no_iommu &&
    2.43 +	    (end_pfn > MAX_DMA32_PFN || force_iommu))
    2.44 +	       swiotlb = 1;
    2.45 +	if (swiotlb) {
    2.46 +		swiotlb_init();
    2.47 +		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
    2.48 +		dma_ops = &swiotlb_dma_ops;
    2.49 +	}
    2.50 +#else
    2.51 +	swiotlb_init();
    2.52 +	if (swiotlb) {
    2.53 +		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
    2.54 +		dma_ops = &swiotlb_dma_ops;
    2.55 +	}
    2.56 +#endif
    2.57 +}
     3.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Fri Feb 10 03:23:36 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Fri Feb 10 12:35:19 2006 +0100
     3.3 @@ -869,7 +869,7 @@ void __init mem_init(void)
     3.4  	memset(contiguous_bitmap, 0, (end_pfn + 2*BITS_PER_LONG) >> 3);
     3.5  
     3.6  #if defined(CONFIG_SWIOTLB)
     3.7 -	swiotlb_init();	
     3.8 +	pci_swiotlb_init();	
     3.9  #endif
    3.10  	no_iommu_init();
    3.11