]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/topology: Set cpu_die_id only if DIE_TYPE found
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 9 Nov 2020 21:06:59 +0000 (21:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 17:14:15 +0000 (18:14 +0100)
commitf5ad52da145a460b11d3a02a74c995fc33cce2f0
tree8ddf14eef8df6fe964208c49e52288796d039889
parent570fa3bcd2f9328efc2123f8c46a50ea6b64b004
x86/topology: Set cpu_die_id only if DIE_TYPE found

[ Upstream commit cb09a379724d299c603a7a79f444f52a9a75b8d2 ]

CPUID Leaf 0x1F defines a DIE_TYPE level (nb: ECX[8:15] level type == 0x5),
but CPUID Leaf 0xB does not. However, detect_extended_topology() will
set struct cpuinfo_x86.cpu_die_id regardless of whether a valid Die ID
was found.

Only set cpu_die_id if a DIE_TYPE level is found. CPU topology code may
use another value for cpu_die_id, e.g. the AMD NodeId on AMD-based
systems. Code ordering should be maintained so that the CPUID Leaf 0x1F
Die ID value will take precedence on systems that may use another value.

Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20201109210659.754018-5-Yazen.Ghannam@amd.com
Stable-dep-of: 2b12a7a126d6 ("x86/topology: Fix multiple packages shown on a single-package system")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/cpu/topology.c