]> git.baikalelectronics.ru Git - kernel.git/commit
x86/cacheinfo: Add a cpu_llc_shared_mask() UP variant
authorBorislav Petkov <bp@suse.de>
Fri, 19 Aug 2022 17:47:44 +0000 (19:47 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 28 Sep 2022 16:35:37 +0000 (18:35 +0200)
commit783372aa47e4a1977a718c957ebb16d9c6974c8c
tree15b64f4c405a91cf8952b34f47851a10ac3baff8
parentf58a7288d2647741f01d2bf581b7f7fc0af35d30
x86/cacheinfo: Add a cpu_llc_shared_mask() UP variant

On a CONFIG_SMP=n kernel, the LLC shared mask is 0, which prevents
__cache_amd_cpumap_setup() from doing the L3 masks setup, and more
specifically from setting up the shared_cpu_map and shared_cpu_list
files in sysfs, leading to lscpu from util-linux getting confused and
segfaulting.

Add a cpu_llc_shared_mask() UP variant which returns a mask with a
single bit set, i.e., for CPU0.

Fixes: a5d5d5b37900 ("x86/cpu/amd: Derive L3 shared_cpu_map from cpu_llc_shared_mask")
Reported-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1660148115-302-1-git-send-email-ssengar@linux.microsoft.com
arch/x86/include/asm/smp.h