linux/arch/x86/kernel/apic
Steve Wahl 5290e88ba2 x86/platform/uv: Use alternate source for socket to node data
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
2023-09-11 10:06:22 -07:00
..
apic_common.c x86/apic: Sanitize APIC ID range validation 2023-08-09 11:58:32 -07:00
apic_flat_64.c x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
apic_noop.c x86/apic: Remove pointless arguments from [native_]eoi_write() 2023-08-09 11:58:33 -07:00
apic_numachip.c x86/apic: Remove pointless arguments from [native_]eoi_write() 2023-08-09 11:58:33 -07:00
apic.c x86/apic: Wrap IPI calls into helper functions 2023-08-09 12:00:55 -07:00
bigsmp_32.c x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
hw_nmi.c * Rework apic callbacks, getting rid of unnecessary ones and 2023-08-30 10:44:46 -07:00
init.c x86/apic: Provide static call infrastructure for APIC callbacks 2023-08-09 12:00:55 -07:00
io_apic.c x86/apic: Nuke ack_APIC_irq() 2023-08-09 11:58:34 -07:00
ipi.c * Rework apic callbacks, getting rid of unnecessary ones and 2023-08-30 10:44:46 -07:00
local.h x86/apic: Sanitize APIC ID range validation 2023-08-09 11:58:32 -07:00
Makefile x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
msi.c x86/apic: Rename disable_apic 2023-08-09 11:58:16 -07:00
probe_32.c x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
probe_64.c x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
vector.c x86/apic: Wrap IPI calls into helper functions 2023-08-09 12:00:55 -07:00
x2apic_cluster.c x86/apic: Remove pointless arguments from [native_]eoi_write() 2023-08-09 11:58:33 -07:00
x2apic_phys.c x86/apic: Remove pointless arguments from [native_]eoi_write() 2023-08-09 11:58:33 -07:00
x2apic_uv_x.c x86/platform/uv: Use alternate source for socket to node data 2023-09-11 10:06:22 -07:00