ia64/linux-2.6.18-xen.hg

changeset 528:5d938fac27a2

merge with linux-2.6.18-xen.hg
author Alex Williamson <alex.williamson@hp.com>
date Thu Apr 24 14:08:54 2008 -0600 (2008-04-24)
parents ae505684a995 81c5a517a42b
children f6fcc65413ae
files
line diff
     1.1 --- a/arch/i386/kernel/setup-xen.c	Tue Apr 15 11:10:27 2008 -0600
     1.2 +++ b/arch/i386/kernel/setup-xen.c	Thu Apr 24 14:08:54 2008 -0600
     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);
     2.1 --- a/arch/x86_64/kernel/e820-xen.c	Tue Apr 15 11:10:27 2008 -0600
     2.2 +++ b/arch/x86_64/kernel/e820-xen.c	Thu Apr 24 14:08:54 2008 -0600
     2.3 @@ -45,6 +45,10 @@ unsigned long end_user_pfn = MAXMEM>>PAG
     2.4  
     2.5  extern struct resource code_resource, data_resource;
     2.6  
     2.7 +#ifdef CONFIG_XEN
     2.8 +extern struct e820map machine_e820;
     2.9 +#endif
    2.10 +
    2.11  /* Check for some hardcoded bad areas that early boot is not allowed to touch */ 
    2.12  static inline int bad_addr(unsigned long *addrp, unsigned long size)
    2.13  { 
    2.14 @@ -109,8 +113,6 @@ int e820_any_mapped(unsigned long start,
    2.15  	for (i = 0; i < e820.nr_map; i++) { 
    2.16  		struct e820entry *ei = &e820.map[i]; 
    2.17  #else
    2.18 -	extern struct e820map machine_e820;
    2.19 -
    2.20  	if (!is_initial_xendomain())
    2.21  		return 0;
    2.22  	for (i = 0; i < machine_e820.nr_map; i++) {
    2.23 @@ -141,8 +143,6 @@ int __init e820_all_mapped(unsigned long
    2.24  	for (i = 0; i < e820.nr_map; i++) {
    2.25  		struct e820entry *ei = &e820.map[i];
    2.26  #else
    2.27 -	extern struct e820map machine_e820;
    2.28 -
    2.29  	if (!is_initial_xendomain())
    2.30  		return 0;
    2.31  	for (i = 0; i < machine_e820.nr_map; i++) {
    2.32 @@ -604,6 +604,21 @@ static int __init copy_e820_map(struct e
    2.33  
    2.34  		add_memory_region(start, size, type);
    2.35  	} while (biosmap++,--nr_map);
    2.36 +
    2.37 +#ifdef CONFIG_XEN
    2.38 +	if (is_initial_xendomain()) {
    2.39 +		struct xen_memory_map memmap;
    2.40 +
    2.41 +		memmap.nr_entries = E820MAX;
    2.42 +		set_xen_guest_handle(memmap.buffer, machine_e820.map);
    2.43 +
    2.44 +		if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
    2.45 +			BUG();
    2.46 +		machine_e820.nr_map = memmap.nr_entries;
    2.47 +	} else
    2.48 +		machine_e820 = e820;
    2.49 +#endif
    2.50 +
    2.51  	return 0;
    2.52  }
    2.53  
     3.1 --- a/arch/x86_64/kernel/setup-xen.c	Tue Apr 15 11:10:27 2008 -0600
     3.2 +++ b/arch/x86_64/kernel/setup-xen.c	Thu Apr 24 14:08:54 2008 -0600
     3.3 @@ -903,18 +903,8 @@ void __init setup_arch(char **cmdline_p)
     3.4  	 */
     3.5  	probe_roms();
     3.6  #ifdef CONFIG_XEN
     3.7 -	if (is_initial_xendomain()) {
     3.8 -		struct xen_memory_map memmap;
     3.9 -
    3.10 -		memmap.nr_entries = E820MAX;
    3.11 -		set_xen_guest_handle(memmap.buffer, machine_e820.map);
    3.12 -
    3.13 -		if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
    3.14 -			BUG();
    3.15 -		machine_e820.nr_map = memmap.nr_entries;
    3.16 -
    3.17 +	if (is_initial_xendomain())
    3.18  		e820_reserve_resources(machine_e820.map, machine_e820.nr_map);
    3.19 -	}
    3.20  #else
    3.21  	e820_reserve_resources(e820.map, e820.nr_map);
    3.22  #endif