x86/cpu/amd: Make the CPUID 0x80000008 parser correct
authorThomas Gleixner <tglx@linutronix.de>
Wed, 10 Apr 2024 19:45:27 +0000 (21:45 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 12 Apr 2024 10:05:54 +0000 (12:05 +0200)
commit1b3108f6898ef2e03973d65255182792e94e2240
tree11f1d08ca1396a991b81ea9e735f77bcefce12a7
parent4f511739c54b549061993b53fc0380f48dfca23b
x86/cpu/amd: Make the CPUID 0x80000008 parser correct

CPUID 0x80000008 ECX.cpu_nthreads describes the number of threads in the
package. The parser uses this value to initialize the SMT domain level.

That's wrong because cpu_nthreads does not describe the number of threads
per physical core. So this needs to set the CORE domain level and let the
later parsers set the SMT shift if available.

Preset the SMT domain level with the assumption of one thread per core,
which is correct ifrt here are no other CPUID leafs to parse, and propagate
cpu_nthreads and the core level APIC bitwidth into the CORE domain.

Fixes: f7fb3b2dd92c ("x86/cpu: Provide an AMD/HYGON specific topology parser")
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Reported-by: Laura Nao <laura.nao@collabora.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Laura Nao <laura.nao@collabora.com>
Link: https://lore.kernel.org/r/20240410194311.535206450@linutronix.de
arch/x86/kernel/cpu/topology_amd.c