ia64/xen-unstable

changeset 4735:1d7635794bb8

bitkeeper revision 1.1327.1.22 (42767ae6pMJH90d_vWODEW1wraCMTg)

Oops, reenable swiotlb (more last round :-)
author djm@kirby.fc.hp.com
date Mon May 02 19:09:26 2005 +0000 (2005-05-02)
parents 59467f76b967
children 96530b133124
files .rootkeys xen/arch/ia64/lib/Makefile xen/arch/ia64/patch/linux-2.6.11/swiotlb.c xen/arch/ia64/tools/mkbuildtree xen/arch/ia64/xenmisc.c
line diff
     1.1 --- a/.rootkeys	Mon May 02 17:39:04 2005 +0000
     1.2 +++ b/.rootkeys	Mon May 02 19:09:26 2005 +0000
     1.3 @@ -1100,6 +1100,7 @@ 425ae516QfmjiF_a-mabAXqV8Imzkg xen/arch/
     1.4  425ae516EWaNOBEnc1xnphTbRmNZsw xen/arch/ia64/patch/linux-2.6.11/processor.h
     1.5  425ae516LecDyXlwh3NLBtHZKXmMcA xen/arch/ia64/patch/linux-2.6.11/series
     1.6  425ae516RFiPn2CGkpJ21LM-1lJcQg xen/arch/ia64/patch/linux-2.6.11/setup.c
     1.7 +425ae516FX_10YaKGMU8Ysf7kkdm_A xen/arch/ia64/patch/linux-2.6.11/swiotlb.c
     1.8  425ae516p4ICTkjqNYEfYFxqULj4dw xen/arch/ia64/patch/linux-2.6.11/system.h
     1.9  425ae516juUB257qrwUdsL9AsswrqQ xen/arch/ia64/patch/linux-2.6.11/time.c
    1.10  425ae5167zQn7zYcgKtDUDX2v-e8mw xen/arch/ia64/patch/linux-2.6.11/tlb.c
     2.1 --- a/xen/arch/ia64/lib/Makefile	Mon May 02 17:39:04 2005 +0000
     2.2 +++ b/xen/arch/ia64/lib/Makefile	Mon May 02 19:09:26 2005 +0000
     2.3 @@ -9,7 +9,7 @@ OBJS := __divsi3.o __udivsi3.o __modsi3.
     2.4  	bitop.o checksum.o clear_page.o csum_partial_copy.o copy_page.o	\
     2.5  	clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o	\
     2.6  	flush.o ip_fast_csum.o do_csum.o copy_user.o			\
     2.7 -	memset.o strlen.o memcpy.o
     2.8 +	memset.o strlen.o memcpy.o swiotlb.o
     2.9  
    2.10  default: $(OBJS)
    2.11  	$(LD) -r -o ia64lib.o $(OBJS)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/arch/ia64/patch/linux-2.6.11/swiotlb.c	Mon May 02 19:09:26 2005 +0000
     3.3 @@ -0,0 +1,77 @@
     3.4 + swiotlb.c |   21 +++++++++++++--------
     3.5 + 1 files changed, 13 insertions(+), 8 deletions(-)
     3.6 +
     3.7 +Index: linux-2.6.11-xendiffs/arch/ia64/lib/swiotlb.c
     3.8 +===================================================================
     3.9 +--- linux-2.6.11-xendiffs.orig/arch/ia64/lib/swiotlb.c	2005-04-08 12:13:54.040202667 -0500
    3.10 ++++ linux-2.6.11-xendiffs/arch/ia64/lib/swiotlb.c	2005-04-08 12:19:09.170367318 -0500
    3.11 +@@ -124,8 +124,11 @@ swiotlb_init_with_default_size (size_t d
    3.12 + 	/*
    3.13 + 	 * Get IO TLB memory from the low pages
    3.14 + 	 */
    3.15 +-	io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs *
    3.16 +-					       (1 << IO_TLB_SHIFT));
    3.17 ++	/* FIXME: Do we really need swiotlb in HV? If all memory trunks
    3.18 ++	 * presented to guest as <4G, are actually <4G in machine range,
    3.19 ++	 * no DMA intevention from HV...
    3.20 ++	 */
    3.21 ++	io_tlb_start = alloc_xenheap_pages(get_order(io_tlb_nslabs * (1 << IO_TLB_SHIFT)));
    3.22 + 	if (!io_tlb_start)
    3.23 + 		panic("Cannot allocate SWIOTLB buffer");
    3.24 + 	io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
    3.25 +@@ -135,16 +138,16 @@ swiotlb_init_with_default_size (size_t d
    3.26 + 	 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
    3.27 + 	 * between io_tlb_start and io_tlb_end.
    3.28 + 	 */
    3.29 +-	io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int));
    3.30 ++	io_tlb_list = alloc_xenheap_pages(get_order(io_tlb_nslabs * sizeof(int)));
    3.31 + 	for (i = 0; i < io_tlb_nslabs; i++)
    3.32 +  		io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
    3.33 + 	io_tlb_index = 0;
    3.34 +-	io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *));
    3.35 ++	io_tlb_orig_addr = alloc_xenheap_pages(get_order(io_tlb_nslabs * sizeof(char *)));
    3.36 + 
    3.37 + 	/*
    3.38 + 	 * Get the overflow emergency buffer
    3.39 + 	 */
    3.40 +-	io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
    3.41 ++	io_tlb_overflow_buffer = alloc_xenheap_pages(get_order(io_tlb_overflow));
    3.42 + 	printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n",
    3.43 + 	       virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end));
    3.44 + }
    3.45 +@@ -328,13 +331,13 @@ swiotlb_alloc_coherent(struct device *hw
    3.46 + 	 */
    3.47 + 	flags |= GFP_DMA;
    3.48 + 
    3.49 +-	ret = (void *)__get_free_pages(flags, order);
    3.50 ++	ret = (void *)alloc_xenheap_pages(get_order(size));
    3.51 + 	if (ret && address_needs_mapping(hwdev, virt_to_phys(ret))) {
    3.52 + 		/*
    3.53 + 		 * The allocated memory isn't reachable by the device.
    3.54 + 		 * Fall back on swiotlb_map_single().
    3.55 + 		 */
    3.56 +-		free_pages((unsigned long) ret, order);
    3.57 ++		free_xenheap_pages((unsigned long) ret, order);
    3.58 + 		ret = NULL;
    3.59 + 	}
    3.60 + 	if (!ret) {
    3.61 +@@ -372,7 +375,7 @@ swiotlb_free_coherent(struct device *hwd
    3.62 + {
    3.63 + 	if (!(vaddr >= (void *)io_tlb_start
    3.64 +                     && vaddr < (void *)io_tlb_end))
    3.65 +-		free_pages((unsigned long) vaddr, get_order(size));
    3.66 ++		free_xenheap_pages((unsigned long) vaddr, get_order(size));
    3.67 + 	else
    3.68 + 		/* DMA_TO_DEVICE to avoid memcpy in unmap_single */
    3.69 + 		swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE);
    3.70 +@@ -388,8 +391,10 @@ swiotlb_full(struct device *dev, size_t 
    3.71 + 	 * When the mapping is small enough return a static buffer to limit
    3.72 + 	 * the damage, or panic when the transfer is too big.
    3.73 + 	 */
    3.74 ++#ifndef XEN
    3.75 + 	printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
    3.76 + 	       "device %s\n", size, dev ? dev->bus_id : "?");
    3.77 ++#endif
    3.78 + 
    3.79 + 	if (size > io_tlb_overflow && do_panic) {
    3.80 + 		if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
     4.1 --- a/xen/arch/ia64/tools/mkbuildtree	Mon May 02 17:39:04 2005 +0000
     4.2 +++ b/xen/arch/ia64/tools/mkbuildtree	Mon May 02 19:09:26 2005 +0000
     4.3 @@ -142,7 +142,7 @@ softlink arch/ia64/lib/strlen_user.S arc
     4.4  softlink arch/ia64/lib/strncpy_from_user.S arch/ia64/lib/strncpy_from_user.S
     4.5  softlink arch/ia64/lib/strnlen_user.S arch/ia64/lib/strnlen_user.S
     4.6  #softlink arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c
     4.7 -#cp_patch arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c swiotlb.c
     4.8 +cp_patch arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c swiotlb.c
     4.9  softlink arch/ia64/lib/xor.S arch/ia64/lib/xor.S
    4.10  
    4.11  softlink lib/cmdline.c arch/ia64/cmdline.c
    4.12 @@ -151,19 +151,19 @@ softlink arch/ia64/hp/sim/hpsim.S arch/i
    4.13  
    4.14  # xen/include/asm-generic files
    4.15  
    4.16 -softlink include/asm-generic/bug.h include/asm-generic/bug.h bug.h
    4.17 -softlink include/asm-generic/div64.h include/asm-generic/div64.h div64.h
    4.18 +softlink include/asm-generic/bug.h include/asm-generic/bug.h
    4.19 +softlink include/asm-generic/div64.h include/asm-generic/div64.h
    4.20  softlink include/asm-generic/errno.h include/asm-generic/errno.h
    4.21  softlink include/asm-generic/errno-base.h include/asm-generic/errno-base.h
    4.22 -softlink include/asm-generic/ide_iops.h include/asm-generic/ide_iops.h ide_iops.h
    4.23 -softlink include/asm-generic/iomap.h include/asm-generic/iomap.h iomap.h
    4.24 -softlink include/asm-generic/pci-dma-compat.h include/asm-generic/pci-dma-compat.h pci-dma-compat.h
    4.25 -softlink include/asm-generic/pci.h include/asm-generic/pci.h pci.h
    4.26 -softlink include/asm-generic/pgtable.h include/asm-generic/pgtable.h pgtable.h
    4.27 -softlink include/asm-generic/pgtable-nopud.h include/asm-generic/pgtable-nopud.h pgtable-nopud.h
    4.28 -softlink include/asm-generic/sections.h include/asm-generic/sections.h sections.h
    4.29 -softlink include/asm-generic/topology.h include/asm-generic/topology.h topology.h
    4.30 -softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h vmlinux.lds.h
    4.31 +softlink include/asm-generic/ide_iops.h include/asm-generic/ide_iops.h
    4.32 +softlink include/asm-generic/iomap.h include/asm-generic/iomap.h
    4.33 +softlink include/asm-generic/pci-dma-compat.h include/asm-generic/pci-dma-compat.h
    4.34 +softlink include/asm-generic/pci.h include/asm-generic/pci.h
    4.35 +softlink include/asm-generic/pgtable.h include/asm-generic/pgtable.h
    4.36 +softlink include/asm-generic/pgtable-nopud.h include/asm-generic/pgtable-nopud.h
    4.37 +softlink include/asm-generic/sections.h include/asm-generic/sections.h
    4.38 +softlink include/asm-generic/topology.h include/asm-generic/topology.h
    4.39 +softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h
    4.40  
    4.41  
    4.42  # xen/include/asm-ia64 files
     5.1 --- a/xen/arch/ia64/xenmisc.c	Mon May 02 17:39:04 2005 +0000
     5.2 +++ b/xen/arch/ia64/xenmisc.c	Mon May 02 19:09:26 2005 +0000
     5.3 @@ -33,7 +33,7 @@ void ia64_patch_vtop(unsigned long a, un
     5.4  void hpsim_setup(char **x) { }
     5.5  
     5.6  // called from mem_init... don't think s/w I/O tlb is needed in Xen
     5.7 -void swiotlb_init(void) { }
     5.8 +//void swiotlb_init(void) { }  ...looks like it IS needed
     5.9  
    5.10  long
    5.11  is_platform_hp_ski(void)