Merge branches 'x86/cleanups', 'x86/mpparse', 'x86/numa' and 'x86/uv' into x86/urgent
[cascardo/linux.git] / arch / x86 / kernel / smpboot.c
index 31869bf..07576be 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     x86 SMP booting functions
  *
- *     (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
+ *     (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
  *     (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
  *     Copyright 2001 Andi Kleen, SuSE Labs.
  *
@@ -496,7 +496,7 @@ void __cpuinit set_cpu_sibling_map(int cpu)
 }
 
 /* maps the cpu to the sched domain representing multi-core */
-cpumask_t cpu_coregroup_map(int cpu)
+const struct cpumask *cpu_coregroup_mask(int cpu)
 {
        struct cpuinfo_x86 *c = &cpu_data(cpu);
        /*
@@ -504,9 +504,14 @@ cpumask_t cpu_coregroup_map(int cpu)
         * And for power savings, we return cpu_core_map
         */
        if (sched_mc_power_savings || sched_smt_power_savings)
-               return per_cpu(cpu_core_map, cpu);
+               return &per_cpu(cpu_core_map, cpu);
        else
-               return c->llc_shared_map;
+               return &c->llc_shared_map;
+}
+
+cpumask_t cpu_coregroup_map(int cpu)
+{
+       return *cpu_coregroup_mask(cpu);
 }
 
 static void impress_friends(void)
@@ -1149,7 +1154,7 @@ static void __init smp_cpu_index_default(void)
        for_each_possible_cpu(i) {
                c = &cpu_data(i);
                /* mark all to hotplug */
-               c->cpu_index = NR_CPUS;
+               c->cpu_index = nr_cpu_ids;
        }
 }
 
@@ -1293,6 +1298,8 @@ __init void prefill_possible_map(void)
        else
                possible = setup_possible_cpus;
 
+       total_cpus = max_t(int, possible, num_processors + disabled_cpus);
+
        if (possible > CONFIG_NR_CPUS) {
                printk(KERN_WARNING
                        "%d Processors exceeds NR_CPUS limit of %d\n",