From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 805463D0905 for ; Fri, 20 Mar 2026 17:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.143.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774027185; cv=none; b=AB5EN4dr/Ri6mobxiq1P6jdNtmuPHmazg3RcdySaDuIAkm/ha5QKktl7kM970Rk1mbgRgjnEWYCvOlzBfQmf0xDBFQirraqoJ6wyfTOTZ1hxL5S5hu8iw5JqRkXtzOYCflzH1VHrh13xcdcUgX0AoXzCX7QV3C4YDIAJheo4Eo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774027185; c=relaxed/simple; bh=0uH2g6AJIgwcyBqYgpomQwB3fTNPlw22bM7F2eLD81Y=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=P2c0+3dCpEJ9CfFB+7IQa9kkXVGcaAR/2PfKHkWzARcLz6BBn+gBw0QanAMFgxq+de5p70t0XQ4aTeybxRD72Ks7bq3kuetmNiCxXqbPj7eZ8QvjlScxJVqHiN/vPA4VasD8F9Y3HxNHGVr8eIoJwazbAPLt41RCi5T8F47kUNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com; spf=pass smtp.mailfrom=hpe.com; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b=BicvJq95; arc=none smtp.client-ip=148.163.143.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hpe.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="BicvJq95" Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62KE5dZg573638; Fri, 20 Mar 2026 17:19:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=cc :content-type:date:from:message-id:mime-version:subject:to; s= pps0720; bh=AhQPSBFY18GVCkeJu9MORFl97PMTfqy5qs7eRppFcGQ=; b=Bicv Jq953dMdSoRRPqUfGRrTPJp5jTWpB6KnPZbgL7bDWpzH1NHfyWWlt94uiHjzuK+W 8l7e0gulBPHi+w5Pilm3waQz+yu3+QUs+zou53NbSt2t3kv6PTGalazghrtR/6F5 /skPa36pvK5jjZ+69oFPG8CRRm7cg0QVDbb8YwJ4XSQKIRtEPO3KD90m8iqi3ALq buMLhAeedRaiCQEe848TL/OT4ZcEH6jUis6owqKPgSwgxlUF5vokZS+ivVGy5Jkf JSv2Hbc+CF19x9Ry45ylux1863P9aXTEdV3PUzyVcmZ0JJtDADInSCNUcnOnT+tH CjwhOK42tv1qXXnPgA== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 4d171pjt5w-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 20 Mar 2026 17:19:24 +0000 (GMT) Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id C9E50D1D8; Fri, 20 Mar 2026 17:19:23 +0000 (UTC) Received: from HPE-5CG20646DK.localdomain (unknown [16.231.227.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTPS id 69EC7806B4C; Fri, 20 Mar 2026 17:19:22 +0000 (UTC) Date: Fri, 20 Mar 2026 12:19:20 -0500 From: Kyle Meyer To: bp@alien8.de, dave.hansen@linux.intel.com, mingo@redhat.com, steve.wahl@hpe.com, tglx@kernel.org Cc: dimitri.sivanich@hpe.com, hpa@zytor.com, justin.ernst@hpe.com, kyle.meyer@hpe.com, russ.anderson@hpe.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] x86/platform/uv: Handle deconfigured sockets Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzIwMDEzOSBTYWx0ZWRfXyUI1midiqiuu Yb4hSmMhnTLeXolGOPodcZEd7ZAxObZfk1zvqLs9wQHwP3fZ/Oud86HwwlkiKOJtUgGRDE1Ya5b Zve4gc1XIjJhrEVRfMCv+hKXAT7IIiLeIW4SGXjqlOheyyEnacoLgeOr5JP2J0PJhLatAqUIF2B VsLnvjUTcCRhgArtO71Q5rcSuwW8+pV8HYg+11lm4bxgH38Mpu5LedXxttW/unVg/Z/CVHyF0Vv dJ/BxCw7g+ZqsLNkP6jaTfOrzRfj+6hNg8OCeejVJR+0/iEeYqaoddHI1QV2DZ5eZUG2Ne4tPN/ H64TgDfl3qNQ+95+iwj0HvC638uux8P4OwGCrTgdIiM2jeBKLeYLzbsyLCzAOYrSTGxljMCf/5q +NjHD0b7ltYG8d6JxB+G6HqIj2RQQFWGYZTiBGoeQ09W7Vc9IkDIccigrTYsQewVC2wgPTFKHwf w/i6DnKKFlI3nN2uEpA== X-Proofpoint-GUID: UQgRLp2xN8MR6XdMwaDNBTVVBw4Rm8Gn X-Authority-Analysis: v=2.4 cv=XbuEDY55 c=1 sm=1 tr=0 ts=69bd819c cx=c_pps a=5jkVtQsCUlC8zk5UhkBgHg==:117 a=5jkVtQsCUlC8zk5UhkBgHg==:17 a=kj9zAlcOel0A:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gQcMVamqm3wCPoSYhaRC:22 a=3haJ9R1Aw3gUfsUHDaCR:22 a=VwQbUJbxAAAA:8 a=MvuuwTCpAAAA:8 a=MiJN9hvPIQiAcdar65kA:9 a=CjuIK1q_8ugA:10 X-Proofpoint-ORIG-GUID: UQgRLp2xN8MR6XdMwaDNBTVVBw4Rm8Gn X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-20_03,2026-03-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603200139 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 Signed-off-by: Kyle Meyer --- 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