linux-stable/arch
Steve Wahl 0d01a0c304 x86/platform/uv: Use alternate source for socket to node data
commit 5290e88ba2 upstream.

The UV code attempts to build a set of tables to allow it to do
bidirectional socket<=>node lookups.

But when nr_cpus is set to a smaller number than actually present, the
cpu_to_node() mapping information for unused CPUs is not available to
build_socket_tables(). This results in skipping some nodes or sockets
when creating the tables and leaving some -1's for later code to trip.
over, causing oopses.

The problem is that the socket<=>node lookups are created by doing a
loop over all CPUs, then looking up the CPU's APICID and socket. But
if a CPU is not present, there is no way to start this lookup.

Instead of looping over all CPUs, take CPUs out of the equation
entirely. Loop over all APICIDs which are mapped to a valid NUMA node.
Then just extract the socket-id from the APICID.

This avoid tripping over disabled CPUs.

Fixes: 8a50c58519 ("x86/platform/uv: UV support for sub-NUMA clustering")
Signed-off-by: Steve Wahl <steve.wahl@hpe.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20230807141730.1117278-1-steve.wahl%40hpe.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-23 11:14:34 +02:00
..
alpha Kbuild fixes for v6.5 (2nd) 2023-08-13 08:56:24 -07:00
arc ARC: atomics: Add compiler barrier to atomic operations... 2023-09-19 12:30:22 +02:00
arm ARM: 9317/1: kexec: Make smp stop calls asynchronous 2023-09-23 11:14:27 +02:00
arm64 arm64: dts: qcom: sc8280xp-x13s: Add camera activity LED 2023-09-23 11:14:26 +02:00
csky arch/csky patches for 6.5 2023-07-01 21:12:32 -07:00
hexagon Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
ia64 locking: remove spin_lock_prefetch 2023-08-12 09:18:47 -07:00
loongarch LoongArch: mm: Add p?d_leaf() definitions 2023-09-13 09:53:52 +02:00
m68k m68k: Fix invalid .section syntax 2023-07-24 14:50:02 +02:00
microblaze slab updates for 6.5 2023-06-29 16:34:12 -07:00
mips usb: dwc3: dwc3-octeon: Verify clock divider 2023-09-23 11:14:29 +02:00
nios2 slab updates for 6.5 2023-06-29 16:34:12 -07:00
openrisc OpenRISC fix for 6.5 2023-07-12 16:28:53 -07:00
parisc parisc: sba_iommu: Fix build warning if procfs if disabled 2023-09-19 12:30:27 +02:00
powerpc powerpc/pseries: fix possible memory leak in ibmebus_bus_init() 2023-09-23 11:14:27 +02:00
riscv riscv: kexec: Align the kexeced kernel entry 2023-09-23 11:14:32 +02:00
s390 s390/boot: cleanup number of page table levels setup 2023-09-23 11:14:18 +02:00
sh sh: push-switch: Reorder cleanup operations to avoid use-after-free bug 2023-09-19 12:30:21 +02:00
sparc nmi_backtrace: allow excluding an arbitrary CPU 2023-09-13 09:53:08 +02:00
um um: virt-pci: fix missing declaration warning 2023-09-13 09:53:48 +02:00
x86 x86/platform/uv: Use alternate source for socket to node data 2023-09-23 11:14:34 +02:00
xtensa xtensa: PMU: fix base address for the newer hardware 2023-09-13 09:53:51 +02:00
.gitignore
Kconfig - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00