From: "Jan Beulich" Subject: [PATCH, 4.0] x86: don't crash when a CPU cannot be brought online Date: Tue, 11 Jan 2011 09:48:15 +0000 Message-ID: <4D2C356F020000780002B914@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part614D0D4F.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part614D0D4F.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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. An alternative would be to backport -unstable c/s 21436:b127760a4725. Signed-off-by: Jan Beulich --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1098,10 +1098,13 @@ void __init __start_xen(unsigned long mb __cpu_up(i); } =20 - /* Set up cpu_to_node[]. */ - srat_detect_node(i); - /* Set up node_to_cpumask based on cpu_to_node[]. */ - numa_add_cpu(i); =20 + 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); + } } =20 printk("Brought up %ld CPUs\n", (long)num_online_cpus()); --=__Part614D0D4F.0__= Content-Type: text/plain; name="4.0-x86-AP-boot-fail.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="4.0-x86-AP-boot-fail.patch" x86_cpu_to_apicid[] gets set to BAD_APICID when bringup of a secondary=0ACP= U fails, yet srat_detect_node() wants to use this as array index.=0A=0AAn = alternative would be to backport -unstable c/s 21436:b127760a4725.=0A=0ASig= ned-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/setup= .c=0A+++ b/xen/arch/x86/setup.c=0A@@ -1098,10 +1098,13 @@ void __init = __start_xen(unsigned long mb=0A __cpu_up(i);=0A }=0A = =0A- /* Set up cpu_to_node[]. */=0A- srat_detect_node(i);=0A-= /* Set up node_to_cpumask based on cpu_to_node[]. */=0A- = numa_add_cpu(i); =0A+ if ( cpu_online(i) )=0A+ {=0A+ = /* Set up cpu_to_node[]. */=0A+ srat_detect_node(i);= =0A+ /* Set up node_to_cpumask based on cpu_to_node[]. */=0A+ = numa_add_cpu(i);=0A+ }=0A }=0A =0A printk("Brought = up %ld CPUs\n", (long)num_online_cpus());=0A --=__Part614D0D4F.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part614D0D4F.0__=--