ia64/linux-2.6.18-xen.hg

diff arch/i386/kernel/setup-xen.c @ 526:f128849f9e78

linux/x86: set up machine_e820 in copy_e820_map() for it to be usable
earlier (and also for being placed more logically).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 22 14:41:51 2008 +0100 (2008-04-22)
parents f619448beab5
children 6d9e4b02bba4
line diff
     1.1 --- a/arch/i386/kernel/setup-xen.c	Tue Apr 15 15:18:58 2008 +0100
     1.2 +++ b/arch/i386/kernel/setup-xen.c	Tue Apr 22 14:41:51 2008 +0100
     1.3 @@ -736,6 +736,21 @@ int __init copy_e820_map(struct e820entr
     1.4  #endif
     1.5  		add_memory_region(start, size, type);
     1.6  	} while (biosmap++,--nr_map);
     1.7 +
     1.8 +#ifdef CONFIG_XEN
     1.9 +	if (is_initial_xendomain()) {
    1.10 +		struct xen_memory_map memmap;
    1.11 +
    1.12 +		memmap.nr_entries = E820MAX;
    1.13 +		set_xen_guest_handle(memmap.buffer, machine_e820.map);
    1.14 +
    1.15 +		if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
    1.16 +			BUG();
    1.17 +		machine_e820.nr_map = memmap.nr_entries;
    1.18 +	} else
    1.19 +		machine_e820 = e820;
    1.20 +#endif
    1.21 +
    1.22  	return 0;
    1.23  }
    1.24  
    1.25 @@ -1569,18 +1584,8 @@ subsys_initcall(request_standard_resourc
    1.26  static void __init register_memory(void)
    1.27  {
    1.28  #ifdef CONFIG_XEN
    1.29 -	if (is_initial_xendomain()) {
    1.30 -		struct xen_memory_map memmap;
    1.31 -
    1.32 -		memmap.nr_entries = E820MAX;
    1.33 -		set_xen_guest_handle(memmap.buffer, machine_e820.map);
    1.34 -
    1.35 -		if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
    1.36 -			BUG();
    1.37 -
    1.38 -		machine_e820.nr_map = memmap.nr_entries;
    1.39 +	if (is_initial_xendomain())
    1.40  		e820_setup_gap(machine_e820.map, machine_e820.nr_map);
    1.41 -	}
    1.42  	else
    1.43  #endif
    1.44  		e820_setup_gap(e820.map, e820.nr_map);