ia64/xen-unstable

changeset 7835:5e111356ba17

Ensure we initialise the cpu_present_map before
topology_init() is called. In latest Linux kernels it
iterates over cpu_present_map rather than cpu_possible_map.

Also, save/restore should really iterate over
possible cpus, not present ones (not that it really matters,
but it's a small cleanup).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Nov 15 18:43:28 2005 +0100 (2005-11-15)
parents 2acbe70dd418
children 009eb32c0ae4
files linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Nov 15 17:30:55 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Nov 15 18:43:28 2005 +0100
     1.3 @@ -188,7 +188,7 @@ static int __do_suspend(void *ignore)
     1.4  	xenbus_resume();
     1.5  
     1.6  #ifdef CONFIG_SMP
     1.7 -	for_each_present_cpu(i)
     1.8 +	for_each_cpu(i)
     1.9  		vcpu_prepare(i);
    1.10  
    1.11   out_reenable_cpus:
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 15 17:30:55 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 15 18:43:28 2005 +0100
     2.3 @@ -277,6 +277,18 @@ void __devinit smp_prepare_boot_cpu(void
     2.4  
     2.5  #ifdef CONFIG_HOTPLUG_CPU
     2.6  
     2.7 +/*
     2.8 + * Initialize cpu_present_map late to skip SMP boot code in init/main.c.
     2.9 + * But do it early enough to catch critical for_each_present_cpu() loops
    2.10 + * in i386-specific code.
    2.11 + */
    2.12 +static int __init initialize_cpu_present_map(void)
    2.13 +{
    2.14 +	cpu_present_map = cpu_possible_map;
    2.15 +	return 0;
    2.16 +}
    2.17 +core_initcall(initialize_cpu_present_map);
    2.18 +
    2.19  static void vcpu_hotplug(unsigned int cpu)
    2.20  {
    2.21  	int err;
    2.22 @@ -293,7 +305,6 @@ static void vcpu_hotplug(unsigned int cp
    2.23  	}
    2.24  
    2.25  	if (strcmp(state, "online") == 0) {
    2.26 -		cpu_set(cpu, cpu_present_map);
    2.27  		(void)cpu_up(cpu);
    2.28  	} else if (strcmp(state, "offline") == 0) {
    2.29  		(void)cpu_down(cpu);