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=1796387456; b=qWus9/lyEDpSYABEYRf0ngMfBoSV1jHEOPk8sysFVNcS3K4gDQTYZ1HHvZuMMv34iL3E r6Z5B7rnkfh4MM37H/TLfJcrlEW6wfqbIhNaa0mstclFHMdbt6fm+3oEaRYyK43NqBUh7 /2eYinpq3T++ZwNlvfvrhadrb+5kQYycyk5T2EhvPxgFLOwlUPFrTvdM87hCGnUo96wMO xrAYuSugHoBCSyTC09YiS7fEbuPzdVwJVCJM9s30SrfOs0o1BbV3q7cWrwKmfKKWnwxYc Nqq1YRO57T4GKBuknlGyBd1CUulq+DznDzfNdugmlgR+byBjS3OjZP1LFMEzCcihrTQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387456; 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=gsaDWhveUuVOBMSerxmQFdlhBcS9AMhvNLABtf6gL+k=; b=eL5Ye2QKesXCfp/afcTJS01TszCYaTkkyWLFGBqi5YYGDC4jiViuigk5fy82lx8a6RkE nKdRdPROHSvNRsUPyp/2UHPS5I5aDQnI/6KkOMxHXDupkaxHCwniKflTrikhrDhqnaCdA q+2b215gtpvcX2BluKFSK4fcnDjUWz63LJTqEZBbV70nOQzpqapA+NOMBOhnDueAUr/Mg n9RXr28e5G+MasmtQCHBV8oJb5qoVl8xopAYU3NHDVzRMHLBo09X5ar7ohtiF8oWE4d2W 8Md8/8rn2KbN1NlX5o1+aeQNfAeK8pt0T05B3UT+Nu3FeGHPtar72w3N7pZswgDlWmA== 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=tk5KsHkV; 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 C85C2606A32C; Fri, 4 Dec 2026 12:30:56 +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=tk5KsHkV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 044951F000C2; Fri, 4 Dec 2026 12:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387456; bh=gsaDWhveUuVOBMSerxmQFdlhBcS9AMhvNLABtf6gL+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tk5KsHkVwyro6+NTJeRkEORJF3w1dsHER6oW47K0xAeyVPinEB+8U4w3uwZwu8G0g 43iMqSuV/0x7VZ5QuTer0k0gU3Zde4VBVy1gmZDkr4Gsej1B3hioJT3llJzRrxWGIX yR9spUIRFRdRu1lN/6evrYOOEfKvcVrVbDquQB7Y= 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.1 0251/1059] cxl/test: Map mock device nodes to an online node Date: Fri, 4 Dec 2026 18:56:22 +0900 Message-ID: <20261204100650.772926856@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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: Applied the numa_map_to_online_node() wrapping to the two set_dev_node() sites that exist in this older file, since the upstream functions and sections it targets are missing. ] Signed-off-by: Sasha Levin --- tools/testing/cxl/test/cxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c index 37bd29e555903..5ef0f6a454726 100644 --- a/tools/testing/cxl/test/cxl.c +++ b/tools/testing/cxl/test/cxl.c @@ -948,7 +948,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) { @@ -1112,7 +1112,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