From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] x86: correct socket_cpumask allocation for AP Date: Wed, 8 Jul 2015 17:11:04 +0200 Message-ID: <1436368264.22672.219.camel@citrix.com> References: <1436348218-29172-1-git-send-email-chao.p.peng@linux.intel.com> <559D35FD020000780008E354@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5998668924823542353==" Return-path: In-Reply-To: <559D35FD020000780008E354@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Chao Peng , xen-devel@lists.xen.org, keir@xen.org, andrew.cooper3@citrix.com List-Id: xen-devel@lists.xenproject.org --===============5998668924823542353== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-fG7bKGaQc9R++593Wfz8" --=-fG7bKGaQc9R++593Wfz8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-07-08 at 13:38 +0100, Jan Beulich wrote: > >>> On 08.07.15 at 11:36, wrote: > > @@ -84,11 +85,21 @@ void *stack_base[NR_CPUS]; > > static void smp_store_cpu_info(int id) > > { > > struct cpuinfo_x86 *c =3D cpu_data + id; > > + unsigned int socket; > > =20 > > *c =3D boot_cpu_data; > > if ( id !=3D 0 ) > > + { > > identify_cpu(c); > > =20 > > + socket =3D cpu_to_socket(id); > > + if ( !socket_cpumask[socket] ) > > + { > > + socket_cpumask[socket] =3D secondary_socket_cpumask; > > + secondary_socket_cpumask =3D NULL; >=20 > I don't think this will build with small enough NR_CPUS. > And it *does* *not* fix the issue on my box. In fact, even with this applied, I see the following splat, on CPU #0, as you can see: ... (XEN) I/O virtualisation enabled (XEN) Interrupt remapping enabled (XEN) CPU0: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz stepping 02 (XEN) ----[ Xen-4.6-unstable x86_64 debug=3Dy Tainted: C ]---- (XEN) CPU: 0 (XEN) RIP: e008:[] set_cpu_sibling_map+0x65/0x396 (XEN) RFLAGS: 0000000000010287 CONTEXT: hypervisor (XEN) rax: 0000000000000000 rbx: ffff82d080332240 rcx: 0000000000000000 (XEN) rdx: 0000000000000001 rsi: 000000000000000a rdi: ffff82d08029b768 (XEN) rbp: ffff82d0802efe28 rsp: ffff82d0802efdd8 r8: ffff82d0802d5c40 (XEN) r9: 0000000000000001 r10: 0000000000000002 r11: 0000000000000001 (XEN) r12: 0000000000000000 r13: ffff82d0803321e0 r14: ffff82d0803321e0 (XEN) r15: 000000000000000f cr0: 000000008005003b cr4: 00000000000006e0 (XEN) cr3: 00000000dba9a000 cr2: 0000000000000000 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: e008 (XEN) Xen stack trace from rsp=3Dffff82d0802efdd8: (XEN) ffff82d0802efe28 0000000000000020 ffff8303206c3610 ffff82d00000000= 0 (XEN) ffff82d0803321e0 ffff82d080332240 ffff8303206c3610 ffff82d0803321e= 0 (XEN) ffff82d0803321e0 000000000000000f ffff82d0802efe48 ffff82d0802c14b= 3 (XEN) ffff82d0802e8000 ffff82d0802e8000 ffff82d0802eff08 ffff82d0802c0d5= a (XEN) 0000000000000000 ffff82d0802dd900 0000000001478000 000000000032400= 0 (XEN) 0080016300000000 0000000001478001 0000000000000000 000000000000001= 5 (XEN) ffff830000079c80 ffff830000079ee0 0000000100000002 ffff830000079fb= 0 (XEN) 0000000800000000 000000010000006e 0000000000000003 00000000000002f= 8 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 0000000000000000 ffff82d08010007= 3 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 0000000000000000 000000000000000= 0 (XEN) 0000000000000000 0000000000000000 ffff8300dbdf4000 000000000000000= 0 (XEN) 0000000000000000 (XEN) Xen call trace: (XEN) [] set_cpu_sibling_map+0x65/0x396 (XEN) [] smp_prepare_cpus+0x12e/0x24f (XEN) [] __start_xen+0x1ff3/0x2536 (XEN) [] __high_start+0x53/0x55 (XEN)=20 (XEN) Pagetable walk from 0000000000000000: (XEN) L4[0x000] =3D 0000000320734063 ffffffffffffffff (XEN) L3[0x000] =3D 0000000320733063 ffffffffffffffff (XEN) L2[0x000] =3D 0000000320732063 ffffffffffffffff=20 (XEN) L1[0x000] =3D 0000000000000000 ffffffffffffffff (XEN)=20 Jan >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >=20 (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) FATAL PAGE FAULT (XEN) [error_code=3D0002] (XEN) Faulting linear address: 0000000000000000 (XEN) **************************************** ... The configuration of the testbox in question is as follows: root@Zhaman:~# xl info -n ... machine : x86_64 nr_cpus : 16 max_cpu_id : 63 nr_nodes : 2 cores_per_socket : 4 threads_per_core : 2 ... cpu_topology : cpu: core socket node 0: 0 1 0 1: 0 1 0 2: 1 1 0 3: 1 1 0 4: 9 1 0 5: 9 1 0 6: 10 1 0 7: 10 1 0 8: 0 0 1 9: 0 0 1 10: 1 0 1 11: 1 0 1 12: 9 0 1 13: 9 0 1 14: 10 0 1 15: 10 0 1 Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-fG7bKGaQc9R++593Wfz8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlWdPYgACgkQk4XaBE3IOsTu2ACfZh3W277RlcovG8mTfFt2T2pH qwUAmQF8jnoIb/At79Q4F0zGcGOGrxsp =u8hv -----END PGP SIGNATURE----- --=-fG7bKGaQc9R++593Wfz8-- --===============5998668924823542353== 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.xen.org http://lists.xen.org/xen-devel --===============5998668924823542353==--