Convert cpu_sibling_map to be a per cpu variable
[linux-block.git] / arch / ia64 / kernel / setup.c
index 9e392a30d19783d3426ca720b95fbea1221a71ff..777c8d8bd5e70febf80c8e5a8ed0c5d94d85de40 100644 (file)
@@ -528,10 +528,6 @@ setup_arch (char **cmdline_p)
 
 #ifdef CONFIG_SMP
        cpu_physical_id(0) = hard_smp_processor_id();
-
-       cpu_set(0, cpu_sibling_map[0]);
-       cpu_set(0, cpu_core_map[0]);
-
        check_for_logical_procs();
        if (smp_num_cpucores > 1)
                printk(KERN_INFO
@@ -873,6 +869,14 @@ cpu_init (void)
        void *cpu_data;
 
        cpu_data = per_cpu_init();
+       /*
+        * insert boot cpu into sibling and core mapes
+        * (must be done after per_cpu area is setup)
+        */
+       if (smp_processor_id() == 0) {
+               cpu_set(0, per_cpu(cpu_sibling_map, 0));
+               cpu_set(0, cpu_core_map[0]);
+       }
 
        /*
         * We set ar.k3 so that assembly code in MCA handler can compute