]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/cacheinfo: Delete global num_cache_leaves
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Thu, 28 Nov 2024 00:22:47 +0000 (16:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:27 +0000 (20:03 +0100)
commit76ce78cab7055bdb3f4ce30c3fb6a1beb42b9683
treeced25456e8a30a75cb3b232c8df8d7492bf26e13
parent95e197354e0de07e9a20819bdae6562e4dda0f20
x86/cacheinfo: Delete global num_cache_leaves

commit 9677be09e5e4fbe48aeccb06ae3063c5eba331c3 upstream.

Linux remembers cpu_cachinfo::num_leaves per CPU, but x86 initializes all
CPUs from the same global "num_cache_leaves".

This is erroneous on systems such as Meteor Lake, where each CPU has a
distinct num_leaves value. Delete the global "num_cache_leaves" and
initialize num_leaves on each CPU.

init_cache_level() no longer needs to set num_leaves. Also, it never had to
set num_levels as it is unnecessary in x86. Keep checking for zero cache
leaves. Such condition indicates a bug.

  [ bp: Cleanup. ]

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org # 6.3+
Link: https://lore.kernel.org/r/20241128002247.26726-3-ricardo.neri-calderon@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/cacheinfo.c