]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/platform/uv: Handle deconfigured sockets
authorKyle Meyer <kyle.meyer@hpe.com>
Fri, 20 Mar 2026 17:19:20 +0000 (12:19 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 20 Mar 2026 18:01:03 +0000 (19:01 +0100)
When a socket is deconfigured, it's mapped to SOCK_EMPTY (0xffff). This causes
a panic while allocating UV hub info structures.

Fix this by using NUMA_NO_NODE, allowing UV hub info structures to be
allocated on valid nodes.

Fixes: 8a50c5851927 ("x86/platform/uv: UV support for sub-NUMA clustering")
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/ab2BmGL0ehVkkjKk@hpe.com
arch/x86/kernel/apic/x2apic_uv_x.c

index 15209f220e1fda33feaea789312e94747a01911d..42568ceec48162f3b49d7d4673fb12829661c800 100644 (file)
@@ -1708,8 +1708,22 @@ static void __init uv_system_init_hub(void)
                struct uv_hub_info_s *new_hub;
 
                /* Allocate & fill new per hub info list */
-               new_hub = (bid == 0) ?  &uv_hub_info_node0
-                       : kzalloc_node(bytes, GFP_KERNEL, uv_blade_to_node(bid));
+               if (bid == 0) {
+                       new_hub = &uv_hub_info_node0;
+               } else {
+                       int nid;
+
+                       /*
+                        * Deconfigured sockets are mapped to SOCK_EMPTY. Use
+                        * NUMA_NO_NODE to allocate on a valid node.
+                        */
+                       nid = uv_blade_to_node(bid);
+                       if (nid == SOCK_EMPTY)
+                               nid = NUMA_NO_NODE;
+
+                       new_hub = kzalloc_node(bytes, GFP_KERNEL, nid);
+               }
+
                if (WARN_ON_ONCE(!new_hub)) {
                        /* do not kfree() bid 0, which is statically allocated */
                        while (--bid > 0)