ia64/xen-unstable

changeset 12638:a4ba47e9bc1f

Clean up the DMADOM physical upper limit handling to properly honour
settings in config.h.

Set the upper limit for DMADOM and swiotlb allocations to be 30 bits
(1G) instead of 31 bits, to allow the b44 NIC driver to work.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
author kfraser@localhost.localdomain
date Tue Nov 28 16:41:45 2006 +0000 (2006-11-28)
parents 9493864f7a3c
children 1fce8221d473
files linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c xen/common/memory.c xen/include/asm-ia64/config.h xen/include/asm-x86/config.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c	Wed Nov 22 14:25:07 2006 -0700
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c	Tue Nov 28 16:41:45 2006 +0000
     1.3 @@ -47,8 +47,8 @@ EXPORT_SYMBOL(swiotlb);
     1.4   */
     1.5  #define IO_TLB_SHIFT 11
     1.6  
     1.7 -/* Width of DMA addresses in the IO TLB. 31 bits is an aacraid limitation. */
     1.8 -#define IO_TLB_DMA_BITS 31
     1.9 +/* Width of DMA addresses in the IO TLB. 30 bits is a b44 limitation. */
    1.10 +#define IO_TLB_DMA_BITS 30
    1.11  
    1.12  static int swiotlb_force;
    1.13  static char *iotlb_virt_start;
     2.1 --- a/xen/common/memory.c	Wed Nov 22 14:25:07 2006 -0700
     2.2 +++ b/xen/common/memory.c	Tue Nov 28 16:41:45 2006 +0000
     2.3 @@ -328,7 +328,7 @@ static long memory_exchange(XEN_GUEST_HA
     2.4           (exch.out.address_bits <
     2.5            (get_order_from_pages(max_page) + PAGE_SHIFT)) )
     2.6      {
     2.7 -        if ( exch.out.address_bits < 31 )
     2.8 +        if ( exch.out.address_bits < MAX_DMADOM_BITS )
     2.9          {
    2.10              rc = -ENOMEM;
    2.11              goto fail_early;
    2.12 @@ -541,7 +541,7 @@ long do_memory_op(unsigned long cmd, XEN
    2.13               (reservation.address_bits <
    2.14                (get_order_from_pages(max_page) + PAGE_SHIFT)) )
    2.15          {
    2.16 -            if ( reservation.address_bits < 31 )
    2.17 +            if ( reservation.address_bits < MAX_DMADOM_BITS )
    2.18                  return start_extent;
    2.19              args.memflags = MEMF_dma;
    2.20          }
     3.1 --- a/xen/include/asm-ia64/config.h	Wed Nov 22 14:25:07 2006 -0700
     3.2 +++ b/xen/include/asm-ia64/config.h	Tue Nov 28 16:41:45 2006 +0000
     3.3 @@ -41,7 +41,9 @@
     3.4  #define CONFIG_IOSAPIC
     3.5  #define supervisor_mode_kernel (0)
     3.6  
     3.7 -#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
     3.8 +#define MAX_DMADOM_BITS 30
     3.9 +#define MAX_DMADOM_MASK ((1UL << MAX_DMADOM_BITS) - 1)
    3.10 +#define MAX_DMADOM_PFN  (MAX_DMADOM_MASK >> PAGE_SHIFT)
    3.11  
    3.12  /* If PERFC is used, include privop maps.  */
    3.13  #ifdef PERF_COUNTERS
     4.1 --- a/xen/include/asm-x86/config.h	Wed Nov 22 14:25:07 2006 -0700
     4.2 +++ b/xen/include/asm-x86/config.h	Tue Nov 28 16:41:45 2006 +0000
     4.3 @@ -82,7 +82,9 @@
     4.4  /* Debug stack is restricted to 8kB by guard pages. */
     4.5  #define DEBUG_STACK_SIZE 8192
     4.6  
     4.7 -#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
     4.8 +#define MAX_DMADOM_BITS 30
     4.9 +#define MAX_DMADOM_MASK ((1UL << MAX_DMADOM_BITS) - 1)
    4.10 +#define MAX_DMADOM_PFN  (MAX_DMADOM_MASK >> PAGE_SHIFT)
    4.11  
    4.12  #ifndef __ASSEMBLY__
    4.13  extern unsigned long _end; /* standard ELF symbol */