Skip to contentSkip to conversation

x86/platform/uv: Handle deconfigured sockets

PATCH Applied Kyle Meyer 2 participants 2 messages Mar 20

Subsystems (3)
lore
Share & tools
lore

Kyle Meyer

author reviewer
#0 lore raw

PATCH v2 1/1 x86/platform/uv: Handle deconfigured sockets

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")

---

v1 -> v2: Add fixes tag and CC stable, as suggested by Boris.

v1: https://lore.kernel.org/all/[email protected]

---
 arch/x86/kernel/apic/x2apic_uv_x.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
arch/x86/kernel/apic/x2apic_uv_x.c +16 -2
index 15209f220e1f..42568ceec481 100644
@@ -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)
Signature · 1 line
2.43.0
merge bot Applied
#1 lore raw
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     1f6aa5bbf1d0f81a8a2aafc16136e7dd9a609ff3
Gitweb:        https://git.kernel.org/tip/1f6aa5bbf1d0f81a8a2aafc16136e7dd9a609ff3
Author:        Kyle Meyer <[email protected]>
AuthorDate:    Fri, 20 Mar 2026 12:19:20 -05:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Fri, 20 Mar 2026 19:01:03 +01:00

x86/platform/uv: Handle deconfigured sockets

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")
---
 arch/x86/kernel/apic/x2apic_uv_x.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
arch/x86/kernel/apic/x2apic_uv_x.c +16 -2
index 15209f2..42568ce 100644
@@ -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)