# HG changeset patch # User Keir Fraser # Date 1294742461 0 # Node ID 7a203c60d588a7a15a28a6fb16c69feafd157e0d # Parent 64bb7d9904a64cc4561c6d541d857acf46e42180 x86: don't crash when a CPU cannot be brought online during boot References: bnc#656369, bnc#658704 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 Index: xen-4.0.1-testing/xen/arch/x86/setup.c =================================================================== --- xen-4.0.1-testing.orig/xen/arch/x86/setup.c +++ xen-4.0.1-testing/xen/arch/x86/setup.c @@ -1103,10 +1103,13 @@ void __init __start_xen(unsigned long mb __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());