ia64/xen-unstable

changeset 6273:7b6f55756f9c

The entire swiotlb aperture does not need to be contiguous.
Only individual aligned SEGSIZE blocks need to be contiguous.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Aug 19 09:42:12 2005 +0000 (2005-08-19)
parents 2de42ce9ffff
children bf1746842c46 509316987d65
files linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Fri Aug 19 09:36:12 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Fri Aug 19 09:42:12 2005 +0000
     1.3 @@ -94,9 +94,6 @@ setup_io_tlb_npages(char *str)
     1.4  		iotlb_nslabs = simple_strtoul(str, &str, 0) <<
     1.5  			(20 - IO_TLB_SHIFT);
     1.6  		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
     1.7 -		/* Round up to power of two (xen_create_contiguous_region). */
     1.8 -		while (iotlb_nslabs & (iotlb_nslabs-1))
     1.9 -			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
    1.10  	}
    1.11  	if (*str == ',')
    1.12  		++str;
    1.13 @@ -123,9 +120,6 @@ swiotlb_init_with_default_size (size_t d
    1.14  	if (!iotlb_nslabs) {
    1.15  		iotlb_nslabs = (default_size >> IO_TLB_SHIFT);
    1.16  		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
    1.17 -		/* Round up to power of two (xen_create_contiguous_region). */
    1.18 -		while (iotlb_nslabs & (iotlb_nslabs-1))
    1.19 -			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
    1.20  	}
    1.21  
    1.22  	bytes = iotlb_nslabs * (1UL << IO_TLB_SHIFT);
    1.23 @@ -139,8 +133,10 @@ swiotlb_init_with_default_size (size_t d
    1.24  		      "Use dom0_mem Xen boot parameter to reserve\n"
    1.25  		      "some DMA memory (e.g., dom0_mem=-128M).\n");
    1.26  
    1.27 -	xen_create_contiguous_region(
    1.28 -		(unsigned long)iotlb_virt_start, get_order(bytes));
    1.29 +	for (i = 0; i < iotlb_nslabs; i += IO_TLB_SEGSIZE)
    1.30 +		xen_create_contiguous_region(
    1.31 +			(unsigned long)iotlb_virt_start + (i << IO_TLB_SHIFT),
    1.32 +			get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT));
    1.33  
    1.34  	iotlb_virt_end = iotlb_virt_start + bytes;
    1.35