Skip to content
/ linux Public

Commit 79f0faf

Browse files
Kyle Meyergregkh
authored andcommitted
x86/platform/uv: Handle deconfigured sockets
commit 1f6aa5b upstream. 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: 8a50c58 ("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 38539f5 commit 79f0faf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,8 +1708,22 @@ static void __init uv_system_init_hub(void)
17081708
struct uv_hub_info_s *new_hub;
17091709

17101710
/* Allocate & fill new per hub info list */
1711-
new_hub = (bid == 0) ? &uv_hub_info_node0
1712-
: kzalloc_node(bytes, GFP_KERNEL, uv_blade_to_node(bid));
1711+
if (bid == 0) {
1712+
new_hub = &uv_hub_info_node0;
1713+
} else {
1714+
int nid;
1715+
1716+
/*
1717+
* Deconfigured sockets are mapped to SOCK_EMPTY. Use
1718+
* NUMA_NO_NODE to allocate on a valid node.
1719+
*/
1720+
nid = uv_blade_to_node(bid);
1721+
if (nid == SOCK_EMPTY)
1722+
nid = NUMA_NO_NODE;
1723+
1724+
new_hub = kzalloc_node(bytes, GFP_KERNEL, nid);
1725+
}
1726+
17131727
if (WARN_ON_ONCE(!new_hub)) {
17141728
/* do not kfree() bid 0, which is statically allocated */
17151729
while (--bid > 0)

0 commit comments

Comments
 (0)