[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ff58623cdf63dc75fc245fd18ee776465f4bb3b8.camel@intel.com>
Date: Tue, 9 Jan 2024 01:54:17 +0000
From: "Zhang, Rui" <rui.zhang@...el.com>
To: "tglx@...utronix.de" <tglx@...utronix.de>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: "jgross@...e.com" <jgross@...e.com>, "x86@...nel.org" <x86@...nel.org>,
"arjan@...ux.intel.com" <arjan@...ux.intel.com>, "kprateek.nayak@....com"
<kprateek.nayak@....com>, "Tang, Feng" <feng.tang@...el.com>,
"kan.liang@...ux.intel.com" <kan.liang@...ux.intel.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>, "ray.huang@....com"
<ray.huang@....com>, "andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
"Sivanich, Dimitri" <dimitri.sivanich@....com>, "paulmck@...nel.org"
<paulmck@...nel.org>, "Mehta, Sohil" <sohil.mehta@...el.com>,
"andy@...radead.org" <andy@...radead.org>
Subject: Re: [patch 37/53] x86/cpu: Detect real BSP on crash kernels
On Mon, 2024-01-08 at 17:13 +0100, Thomas Gleixner wrote:
> On Mon, Jan 08 2024 at 15:54, Thomas Gleixner wrote:
>
> > On Mon, Jan 08 2024 at 14:11, Zhang, Rui wrote:
> > > > +static __init void check_for_kdump_kernel(void)
> > > > +{
> > > > + u32 bsp_apicid;
> > > > +
> > > > + /*
> > > > + * There is no real good way to detect whether this a
> > > > kdump()
> > > > + * kernel, but except on the Voyager SMP monstrosity
> > > > which is
> > > > not
> > > > + * longer supported, the real BSP has always the lowest
> > > > numbered
> > > > + * APIC ID. If a crash happened on an AP, which then
> > > > ends up
> > > > as
> > > > + * boot CPU in the kdump() kernel, then sending INIT to
> > > > the
> > > > real
> > > > + * BSP would reset the whole system.
> > > > + */
> > >
> > >
> > > Hi, Thomas,
> > >
> > > Unfortunately this causes a regression on Intel Meteorlake
> > > platform,
> > > where the BSP APIC ID is NOT the lowest numbered APIC ID
> > > (instead,
> > > CPU12, the first Ecore CPU, has APIC ID 0).
> >
> > Bah. Let me think about that.
>
> In which order are the APICs/CPUs enumerated by ACPI?
This is the order in MADT,
$ cat apic.dsl | grep x2Apic
[030h 0048 4] Processor x2Apic ID : 00000010
[040h 0064 4] Processor x2Apic ID : 00000011
[050h 0080 4] Processor x2Apic ID : 00000018
[060h 0096 4] Processor x2Apic ID : 00000019
[070h 0112 4] Processor x2Apic ID : 00000020
[080h 0128 4] Processor x2Apic ID : 00000021
[090h 0144 4] Processor x2Apic ID : 00000028
[0A0h 0160 4] Processor x2Apic ID : 00000029
[0B0h 0176 4] Processor x2Apic ID : 00000030
[0C0h 0192 4] Processor x2Apic ID : 00000031
[0D0h 0208 4] Processor x2Apic ID : 00000038
[0E0h 0224 4] Processor x2Apic ID : 00000039
[0F0h 0240 4] Processor x2Apic ID : 00000000
[100h 0256 4] Processor x2Apic ID : 00000002
[110h 0272 4] Processor x2Apic ID : 00000004
[120h 0288 4] Processor x2Apic ID : 00000006
[130h 0304 4] Processor x2Apic ID : 00000008
[140h 0320 4] Processor x2Apic ID : 0000000A
[150h 0336 4] Processor x2Apic ID : 0000000C
[160h 0352 4] Processor x2Apic ID : 0000000E
[170h 0368 4] Processor x2Apic ID : 00000040
[180h 0384 4] Processor x2Apic ID : 00000042
and this is the order in Linux (from CPU0 to CPUN)
x2APIC ID of logical processor = 0x20 (32)
x2APIC ID of logical processor = 0x10 (16)
x2APIC ID of logical processor = 0x11 (17)
x2APIC ID of logical processor = 0x18 (24)
x2APIC ID of logical processor = 0x19 (25)
x2APIC ID of logical processor = 0x21 (33)
x2APIC ID of logical processor = 0x28 (40)
x2APIC ID of logical processor = 0x29 (41)
x2APIC ID of logical processor = 0x30 (48)
x2APIC ID of logical processor = 0x31 (49)
x2APIC ID of logical processor = 0x38 (56)
x2APIC ID of logical processor = 0x39 (57)
x2APIC ID of logical processor = 0x0 (0)
x2APIC ID of logical processor = 0x2 (2)
x2APIC ID of logical processor = 0x4 (4)
x2APIC ID of logical processor = 0x6 (6)
x2APIC ID of logical processor = 0x8 (8)
x2APIC ID of logical processor = 0xa (10)
x2APIC ID of logical processor = 0xc (12)
x2APIC ID of logical processor = 0xe (14)
x2APIC ID of logical processor = 0x40 (64)
x2APIC ID of logical processor = 0x42 (66)
thanks,
rui
Powered by blists - more mailing lists