]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
x86/topology: Fix multiple packages shown on a single-package system
authorZhang Rui <rui.zhang@intel.com>
Fri, 14 Oct 2022 09:01:46 +0000 (17:01 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:25:45 +0000 (14:25 +0100)
commit3f9b11f58a2e4fceca38a7567e135bf8dffc1426
tree072632472313d3eb9204b5875e36096d8c371bc5
parent8f3daad1462e63ac273e34ef9814f95ecdd4e61f
x86/topology: Fix multiple packages shown on a single-package system

BugLink: https://bugs.launchpad.net/bugs/1997113
commit 2b12a7a126d62bdbd81f4923c21bf6e9a7fbd069 upstream.

CPUID.1F/B does not enumerate Package level explicitly, instead, all the
APIC-ID bits above the enumerated levels are assumed to be package ID
bits.

Current code gets package ID by shifting out all the APIC-ID bits that
Linux supports, rather than shifting out all the APIC-ID bits that
CPUID.1F enumerates. This introduces problems when CPUID.1F enumerates a
level that Linux does not support.

For example, on a single package AlderLake-N, there are 2 Ecore Modules
with 4 atom cores in each module.  Linux does not support the Module
level and interprets the Module ID bits as package ID and erroneously
reports a multi module system as a multi-package system.

Fix this by using APIC-ID bits above all the CPUID.1F enumerated levels
as package ID.

[ dhansen: spelling fix ]

Fixes: 7745f03eb395 ("x86/topology: Add CPUID.1F multi-die/package support")
Suggested-by: Len Brown <len.brown@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20221014090147.1836-4-rui.zhang@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/cpu/topology.c