ia64/xen-unstable

changeset 7629:6a2d93c2b32d

Specifying 'mem=' as Linux boot parameter disables the default
8MB slack in the mem_map and the p2m table.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Nov 04 11:46:10 2005 +0100 (2005-11-04)
parents 21d175472d55
children a969d918674e
files linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Fri Nov 04 11:08:45 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Fri Nov 04 11:46:10 2005 +0100
     1.3 @@ -936,11 +936,15 @@ void __init find_max_pfn(void)
     1.4  /* We don't use the fake e820 because we need to respond to user override. */
     1.5  void __init find_max_pfn(void)
     1.6  {
     1.7 -	if ( xen_override_max_pfn < xen_start_info->nr_pages )
     1.8 -		xen_override_max_pfn = xen_start_info->nr_pages;
     1.9 -	max_pfn = xen_override_max_pfn;
    1.10 -	/* 8MB slack, to make up for address space allocations in backends. */
    1.11 -	max_pfn += 8 << (20 - PAGE_SHIFT);
    1.12 +	if (xen_override_max_pfn == 0) {
    1.13 +		max_pfn = xen_start_info->nr_pages;
    1.14 +		/* Default 8MB slack (to balance backend allocations). */
    1.15 +		max_pfn += 8 << (20 - PAGE_SHIFT);
    1.16 +	} else if (xen_override_max_pfn > xen_start_info->nr_pages) {
    1.17 +		max_pfn = xen_override_max_pfn;
    1.18 +	} else {
    1.19 +		max_pfn = xen_start_info->nr_pages;
    1.20 +	}
    1.21  }
    1.22  #endif /* XEN */
    1.23  
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c	Fri Nov 04 11:08:45 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c	Fri Nov 04 11:46:10 2005 +0100
     2.3 @@ -526,15 +526,19 @@ extern union xen_start_info_union xen_st
     2.4  
     2.5  unsigned long __init e820_end_of_ram(void)
     2.6  {
     2.7 -        unsigned long max_end_pfn = xen_start_info->nr_pages;
     2.8 -
     2.9 -	if ( xen_override_max_pfn < max_end_pfn)
    2.10 -		xen_override_max_pfn = max_end_pfn;
    2.11 +        unsigned long max_end_pfn;
    2.12  
    2.13 -	/* 8MB slack, to make up for address space allocations in backends. */
    2.14 -	xen_override_max_pfn += 8 << (20 - PAGE_SHIFT);
    2.15 +	if (xen_override_max_pfn == 0) {
    2.16 +		max_end_pfn = xen_start_info->nr_pages;
    2.17 +		/* Default 8MB slack (to balance backend allocations). */
    2.18 +		max_end_pfn += 8 << (20 - PAGE_SHIFT);
    2.19 +	} else if (xen_override_max_pfn > xen_start_info->nr_pages) {
    2.20 +		max_end_pfn = xen_override_max_pfn;
    2.21 +	} else {
    2.22 +		max_end_pfn = xen_start_info->nr_pages;
    2.23 +	}
    2.24  
    2.25 -	return xen_override_max_pfn;
    2.26 +	return max_end_pfn;
    2.27  }
    2.28  
    2.29  void __init e820_reserve_resources(void)