All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/platform/uv: Handle deconfigured sockets
@ 2026-03-20 17:19 Kyle Meyer
  2026-03-20 19:31 ` [tip: x86/urgent] " tip-bot2 for Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Kyle Meyer @ 2026-03-20 17:19 UTC (permalink / raw)
  To: bp, dave.hansen, mingo, steve.wahl, tglx
  Cc: dimitri.sivanich, hpa, justin.ernst, kyle.meyer, russ.anderson,
	x86, linux-kernel

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")
Cc: stable@vger.kernel.org
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
---

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

v1: https://lore.kernel.org/all/abCgFYI9ezJgCGES@hpe.com

---
 arch/x86/kernel/apic/x2apic_uv_x.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 15209f220e1f..42568ceec481 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-20 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 17:19 [PATCH v2] x86/platform/uv: Handle deconfigured sockets Kyle Meyer
2026-03-20 19:31 ` [tip: x86/urgent] " tip-bot2 for Kyle Meyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.