ia64/xen-unstable

changeset 7608:305649f5ad56

Fix 'nosmp' and ensure that CPU#0 is reported properly
by /proc/cpuinfo. Also fix the sibling and core maps.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Nov 01 17:49:19 2005 +0100 (2005-11-01)
parents 3492adc0ad60
children ae2e13795c63
files linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 01 16:44:25 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 01 17:49:19 2005 +0100
     1.3 @@ -191,10 +191,17 @@ void __init smp_prepare_cpus(unsigned in
     1.4  	int cpu, rc;
     1.5  	struct task_struct *idle;
     1.6  
     1.7 -	if (max_cpus == 0)
     1.8 -		return;
     1.9 +	cpu_data[0] = boot_cpu_data;
    1.10  
    1.11 -	xen_smp_intr_init(0);
    1.12 +	cpu_2_logical_apicid[0] = 0;
    1.13 +	x86_cpu_to_apicid[0] = 0;
    1.14 +
    1.15 +	current_thread_info()->cpu = 0;
    1.16 +	cpu_sibling_map[0] = cpumask_of_cpu(0);
    1.17 +	cpu_core_map[0]    = cpumask_of_cpu(0);
    1.18 +
    1.19 +	if (max_cpus != 0)
    1.20 +		xen_smp_intr_init(0);
    1.21  
    1.22  	for (cpu = 1; cpu < max_cpus; cpu++) {
    1.23  		rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);
    1.24 @@ -236,9 +243,9 @@ void __init smp_prepare_cpus(unsigned in
    1.25  	}
    1.26  
    1.27  	/* Currently, Xen gives no dynamic NUMA/HT info. */
    1.28 -	for (cpu = 0; cpu < NR_CPUS; cpu++) {
    1.29 -		cpus_clear(cpu_sibling_map[cpu]);
    1.30 -		cpus_clear(cpu_core_map[cpu]);
    1.31 +	for (cpu = 1; cpu < NR_CPUS; cpu++) {
    1.32 +		cpu_sibling_map[cpu] = cpumask_of_cpu(cpu);
    1.33 +		cpu_core_map[cpu]    = cpumask_of_cpu(cpu);
    1.34  	}
    1.35  
    1.36  #ifdef CONFIG_X86_IO_APIC
    1.37 @@ -256,17 +263,6 @@ void __devinit smp_prepare_boot_cpu(void
    1.38  	cpu_possible_map = cpumask_of_cpu(0);
    1.39  	cpu_present_map  = cpumask_of_cpu(0);
    1.40  	cpu_online_map   = cpumask_of_cpu(0);
    1.41 -
    1.42 -	cpu_data[0] = boot_cpu_data;
    1.43 -	cpu_2_logical_apicid[0] = 0;
    1.44 -	x86_cpu_to_apicid[0] = 0;
    1.45 -
    1.46 -	current_thread_info()->cpu = 0;
    1.47 -	cpus_clear(cpu_sibling_map[0]);
    1.48 -	cpu_set(0, cpu_sibling_map[0]);
    1.49 -
    1.50 -	cpus_clear(cpu_core_map[0]);
    1.51 -	cpu_set(0, cpu_core_map[0]);
    1.52  }
    1.53  
    1.54  static void vcpu_hotplug(unsigned int cpu)