ia64/xen-unstable

changeset 19110:3449d8e50fb9

x86: Do not check dom0 kernel header for bzimage magic until we are
sure it is mapped. This fixes a crash when running on top of tboot.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 29 01:11:50 2009 +0000 (2009-01-29)
parents 0858f961c77a
children 1bd06ed9369d
files xen/arch/x86/setup.c
line diff
     1.1 --- a/xen/arch/x86/setup.c	Wed Jan 28 17:40:01 2009 +0000
     1.2 +++ b/xen/arch/x86/setup.c	Thu Jan 29 01:11:50 2009 +0000
     1.3 @@ -417,7 +417,7 @@ void __init __start_xen(unsigned long mb
     1.4      unsigned int initrdidx = 1;
     1.5      multiboot_info_t *mbi = __va(mbi_p);
     1.6      module_t *mod = (module_t *)__va(mbi->mods_addr);
     1.7 -    unsigned long nr_pages, modules_length, modules_headroom;
     1.8 +    unsigned long nr_pages, modules_length, modules_headroom = -1;
     1.9      unsigned long allocator_bitmap_end;
    1.10      int i, e820_warn = 0, bytes = 0;
    1.11      struct ns16550_defaults ns16550 = {
    1.12 @@ -617,9 +617,6 @@ void __init __start_xen(unsigned long mb
    1.13       * x86/64, we relocate Xen to higher memory.
    1.14       */
    1.15      modules_length = mod[mbi->mods_count-1].mod_end - mod[0].mod_start;
    1.16 -    modules_headroom = bzimage_headroom(
    1.17 -        (char *)(unsigned long)mod[0].mod_start,
    1.18 -        (unsigned long)(mod[0].mod_end - mod[0].mod_start));
    1.19  
    1.20      for ( i = boot_e820.nr_map-1; i >= 0; i-- )
    1.21      {
    1.22 @@ -724,6 +721,11 @@ void __init __start_xen(unsigned long mb
    1.23          }
    1.24  #endif
    1.25  
    1.26 +        if ( modules_headroom == -1 )
    1.27 +            modules_headroom = bzimage_headroom(
    1.28 +                      (char *)(unsigned long)mod[0].mod_start,
    1.29 +                      (unsigned long)(mod[0].mod_end - mod[0].mod_start));
    1.30 +
    1.31          /* Is the region suitable for relocating the multiboot modules? */
    1.32          if ( !initial_images_start && (s < e) &&
    1.33               ((e-s) >= (modules_length+modules_headroom)) )