From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384807; b=yqwhhXpB4X1BFe/R09PB9Wevw1tjGgkJ5/Iq3xtkVMBWjXSKZQxDKOhfMz+WUXGsJpVZ LDhK8sS+EIrUr9czp/koTFgumL7I4WcRLQp/ENMPRj8SD1+6yikcYKioSzJDXAQwqVEja Tg9ZzyPiG+C3AwQ2PtMczc0BWT1wLhqUKidmYHlgzUgjYWPzzw0//P0CSLu8a2Whq6bls lQeMh/CS7Y6V1rOfwaYd/AjglRl1EG8YbGGQfDACK+qhteztyZbVDFSn2qWh1K8a0+ndT M0qJU+U1IZIjPOK3rKtULysV7chCOoWmRGT/5B8+jYf/zgXc/lRLz/QOI9RqvTTMrVQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384807; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=h4phW39sC/py7NOpKkPO6rGmG+TyjjOLkLAd9TVBCB4=; b=3wbmgpsK37TB9F/LVeewnoCRdlh6RL3gGfd9xt27iANBoEYQkwRI8g50ZJLKUGoUG45F 1fDXiMdB/crXHVucR1nQ+w0U6WNQEFdmgEmnl/e7MgaEKXm2bSuBYOhmTEzcwFsRCaloU jT0hoF25lxx3lCOPdE1ukzOZfJb70XIT59wDU8YT8JJY50Dg3/8xGGZnZm/mmaF/OdYok sdgT7Q04F0sH4jfEDrkkeaeW4626BY/ZCypfawgKXDsr27QiSRgTEeWc+JCZCOmgMc4N/ 4W3A+dbYnkP+UlVwgSgij3THks/22upTeAomVY1lSyebk0jIFPvPNJeIlN3kY3OjBtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="EqIg/+EW"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D12D1606A322; Fri, 4 Dec 2026 11:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=EqIg/+EW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 470E01F000CE; Fri, 4 Dec 2026 11:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384807; bh=h4phW39sC/py7NOpKkPO6rGmG+TyjjOLkLAd9TVBCB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EqIg/+EWbSxMDujruxXN8Fc/raqgjuP6Krp8chTnr+3emTFSlBAQkw/6rxPoL2gML E9149bPo8dYYKk/IpqruUrev8gkCz6hP3QeOQF5ox98tSl5F7bVnLKJp9wLZtyVFIO daSTzVarzSAC7Pv67xjjaJgc94rseLH2S5GKldNc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Davidlohr Bueso , Dave Jiang , Alison Schofield , Shaikh Kamaluddin , "Gregory Price (Meta)" , Sasha Levin Subject: [PATCH 6.6 0302/1167] cxl/test: Map mock device nodes to an online node Date: Fri, 4 Dec 2026 18:55:29 +0900 Message-ID: <20261204100709.892917604@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Davidlohr Bueso [ Upstream commit 6f057dea152574dd044382fd0ba5ed19e3ecba25 ] cxl_type3_mem_init() and cxl_type2_mem_init() assign alternating NUMA nodes to the mock memdevs to model multi-node topologies. On a single-node host node 1 has no pgdat, and the first node-aware allocation in an odd device's probe faults on a NULL zonelist: Oops: general protection fault, probably for non-canonical address 0xdffffc00000006e3 KASAN: probably user-memory-access in range [0x0000000000003718-0x000000000000371f] Workqueue: async async_run_entry_fn RIP: __alloc_frozen_pages_noprof+0x288 new_slab ___slab_alloc __kmalloc_node_track_caller_noprof devm_kmalloc cxl_mock_mem_probe Map the requested node to an online one, as dax_hmem already does for its target node. Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute") Signed-off-by: Davidlohr Bueso Reviewed-by: Dave Jiang Reviewed-by: Alison Schofield Tested-by: Alison Schofield Tested-by: Shaikh Kamaluddin Reviewed-by: Gregory Price (Meta) Link: https://patch.msgid.link/20260831175119.3247915-1-dave@stgolabs.net Signed-off-by: Dave Jiang [ sashal: adapted the NUMA node change to the three set_dev_node() sites present here, dropping the type-2 hunk because that function doesn't exist in this tree. ] Signed-off-by: Sasha Levin --- tools/testing/cxl/test/cxl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c index 0bb93bff74be0..31af241758968 100644 --- a/tools/testing/cxl/test/cxl.c +++ b/tools/testing/cxl/test/cxl.c @@ -1041,7 +1041,7 @@ static __init int cxl_rch_init(void) if (!pdev) goto err_mem; pdev->dev.parent = &rch->dev; - set_dev_node(&pdev->dev, i % 2); + set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2)); rc = platform_device_add(pdev); if (rc) { @@ -1178,7 +1178,7 @@ static __init int cxl_single_init(void) if (!pdev) goto err_mem; pdev->dev.parent = &dport->dev; - set_dev_node(&pdev->dev, i % 2); + set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2)); rc = platform_device_add(pdev); if (rc) { @@ -1357,7 +1357,7 @@ static __init int cxl_test_init(void) if (!pdev) goto err_mem; pdev->dev.parent = &dport->dev; - set_dev_node(&pdev->dev, i % 2); + set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2)); rc = platform_device_add(pdev); if (rc) { -- 2.53.0