]> xenbits.xensource.com Git - xen.git/commitdiff
x86: don't crash when a CPU cannot be brought online during boot
authorKeir Fraser <keir@xen.org>
Tue, 11 Jan 2011 10:41:01 +0000 (10:41 +0000)
committerKeir Fraser <keir@xen.org>
Tue, 11 Jan 2011 10:41:01 +0000 (10:41 +0000)
x86_cpu_to_apicid[] gets set to BAD_APICID when bringup of a secondary
CPU fails, yet srat_detect_node() wants to use this as array index.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/setup.c

index 553a5f5d250e11d543452f185efc1677925e20fc..c34b680dfdce7c4054d7980e6168b38f0c9ddc0b 100644 (file)
@@ -1098,10 +1098,13 @@ void __init __start_xen(unsigned long mbi_p)
             __cpu_up(i);
         }
 
-        /* Set up cpu_to_node[]. */
-        srat_detect_node(i);
-        /* Set up node_to_cpumask based on cpu_to_node[]. */
-        numa_add_cpu(i);        
+        if ( cpu_online(i) )
+        {
+            /* Set up cpu_to_node[]. */
+            srat_detect_node(i);
+            /* Set up node_to_cpumask based on cpu_to_node[]. */
+            numa_add_cpu(i);
+        }
     }
 
     printk("Brought up %ld CPUs\n", (long)num_online_cpus());