ia64/xen-unstable

changeset 18131:a637c023e066

x86/64: Account for allocation bitmap by making Xen heap appropriately larger.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 22 13:36:56 2008 +0100 (2008-07-22)
parents fc44e35b3913
children a47770d74b69
files xen/arch/x86/setup.c
line diff
     1.1 --- a/xen/arch/x86/setup.c	Tue Jul 22 11:56:26 2008 +0100
     1.2 +++ b/xen/arch/x86/setup.c	Tue Jul 22 13:36:56 2008 +0100
     1.3 @@ -521,14 +521,6 @@ void __init __start_xen(unsigned long mb
     1.4      if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) != 0 )
     1.5          EARLY_FAIL("Misaligned CPU0 stack.\n");
     1.6  
     1.7 -    /*
     1.8 -     * Since there are some stubs getting built on the stacks which use
     1.9 -     * direct calls/jumps, the heap must be confined to the lower 2G so
    1.10 -     * that those branches can reach their targets.
    1.11 -     */
    1.12 -    if ( opt_xenheap_megabytes > 2048 )
    1.13 -        opt_xenheap_megabytes = 2048;
    1.14 -
    1.15      if ( e820_raw_nr != 0 )
    1.16      {
    1.17          memmap_type = "Xen-e820";
    1.18 @@ -600,6 +592,23 @@ void __init __start_xen(unsigned long mb
    1.19      /* Sanitise the raw E820 map to produce a final clean version. */
    1.20      max_page = init_e820(memmap_type, e820_raw, &e820_raw_nr);
    1.21  
    1.22 +#ifdef CONFIG_X86_64
    1.23 +    /*
    1.24 +     * On x86/64 we are able to account for the allocation bitmap
    1.25 +     * (allocated in common/page_alloc.c:init_boot_allocator()) stealing
    1.26 +     * from the Xen heap. Here we make the Xen heap appropriately larger.
    1.27 +     */
    1.28 +    opt_xenheap_megabytes += (max_page / 8) >> 20;
    1.29 +#endif
    1.30 +
    1.31 +    /*
    1.32 +     * Since there are some stubs getting built on the stacks which use
    1.33 +     * direct calls/jumps, the heap must be confined to the lower 2G so
    1.34 +     * that those branches can reach their targets.
    1.35 +     */
    1.36 +    if ( opt_xenheap_megabytes > 2048 )
    1.37 +        opt_xenheap_megabytes = 2048;
    1.38 +
    1.39      /* Create a temporary copy of the E820 map. */
    1.40      memcpy(&boot_e820, &e820, sizeof(e820));
    1.41