[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251024104851.4d3030b0.michal.pecio@gmail.com>
Date: Fri, 24 Oct 2025 10:48:51 +0200
From: Michal Pecio <michal.pecio@...il.com>
To: Yazen Ghannam <yazen.ghannam@....com>
Cc: Shyam-sundar.S-k@....com, bhelgaas@...gle.com, hdegoede@...hat.com,
ilpo.jarvinen@...ux.intel.com, jdelvare@...e.com,
linux-edac@...r.kernel.org, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux@...ck-us.net, mario.limonciello@....com,
naveenkrishna.chatradhi@....com, platform-driver-x86@...r.kernel.org,
suma.hegde@....com, tony.luck@...el.com, x86@...nel.org
Subject: Re: [PATCH v3 06/12] x86/amd_nb: Use topology info to get AMD node
count
On Thu, 23 Oct 2025 15:09:01 -0400, Yazen Ghannam wrote:
> On Thu, Oct 23, 2025 at 03:04:29PM -0400, Yazen Ghannam wrote:
> > On Thu, Oct 23, 2025 at 08:25:03PM +0200, Michal Pecio wrote:
> > > On Thu, 23 Oct 2025 12:09:06 -0400, Yazen Ghannam wrote:
> > > > The kernel seems to think there are 6 CPUs on your system:
> > > >
> > > > [ 0.072059] CPU topo: Allowing 4 present CPUs plus 2 hotplug CPUs
> > >
> > > I wonder if this code doesn't break systems which actually support
> > > hotplug, when some sockets aren't populated at boot?
> >
> > I don't know about other vendors, but we don't do physical CPU
> > hotplug. CPU hotplug, in this case, is there are physical CPUs
> > already in the system, but they are not enabled for whatever policy
> > decision. They could be disabled in BIOS, and so the MADT entries
> > will reflect that. Or they can be disabled by kernel parameters.
Thanks for the explanation. Looks like your patch is correct then
and we need to fix the topology somehow.
> Sorry for the rapid emails. Here's another interesting commit:
> f0551af02130 ("x86/topology: Ignore non-present APIC IDs in a present package")
I have this commit on 6.12 but it doesn't help.
As I understand, APIC ID is a bitfield of the form:
[package ID] ... [core ID] [thread ID]
In my case, per debugfs:
domain: Thread shift: 0 dom_size: 1 max_threads: 1
domain: Core shift: 2 dom_size: 4 max_threads: 4
domain: Module shift: 2 dom_size: 1 max_threads: 4
domain: Tile shift: 2 dom_size: 1 max_threads: 4
domain: Die shift: 2 dom_size: 1 max_threads: 4
domain: DieGrp shift: 2 dom_size: 1 max_threads: 4
domain: Package shift: 2 dom_size: 1 max_threads: 4
So my phantom APICs simply look like another package with weird
non-sequential ID. (Probably not an ACPI spec violation yet?)
f0551af02130 only rejects disabled APICs in the same packages as
enabled ones. An earlier proposal in that thread was to reject all
disabled APICs on bare metal unless explicitly "online capable":
https://lore.kernel.org/all/87sf15ugsz.ffs@tglx/
This clearly goes against fed8d8773b8e and it seems to go against
what you wrote about AMD BIOSes potentially marking CPUs as disabled
in MADT and presumably allowing OS to wake them up with ACPI?
You asked elsewhere what happens if I online CPU5/6. I don't have
directories for them in /sys/, so not sure if I need any extra steps
to make them appear, or the kernel considers those CPUs bogus for
some reason and amd_nb could do the same?
Bitmaps from /sys/:
/sys/devices/system/cpu/enabled:0-3
/sys/devices/system/cpu/kernel_max:5
/sys/devices/system/cpu/offline:4-5
/sys/devices/system/cpu/online:0-3
/sys/devices/system/cpu/possible:0-5
/sys/devices/system/cpu/present:0-3
I tried 6.18-rc2 and it's same thing, except EDAC and GART don't work.
On both kernels, possible_cpus=4 fixes it:
[ 0.072066] CPU topo: Limiting to 4 possible CPUs
[ 0.072074] CPU topo: CPU limit of 4 reached. Ignoring further CPUs
[ 0.072082] IOAPIC[0]: apic_id 4, version 33, address 0xfec00000, GSI 0-23
[ 0.072084] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.072086] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
[ 0.072089] ACPI: Using ACPI (MADT) for SMP configuration information
[ 0.072090] ACPI: HPET id: 0x8300 base: 0xfed00000
[ 0.072097] CPU topo: Max. logical packages: 1
[ 0.072097] CPU topo: Max. logical dies: 1
[ 0.072098] CPU topo: Max. dies per package: 1
[ 0.072103] CPU topo: Max. threads per core: 1
[ 0.072105] CPU topo: Num. cores per package: 4
[ 0.072105] CPU topo: Num. threads per package: 4
[ 0.072106] CPU topo: Allowing 4 present CPUs plus 0 hotplug CPUs
[ 0.072107] CPU topo: Rejected CPUs 2
Powered by blists - more mailing lists