From patchwork Mon Mar 10 09:39:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuquan Wang X-Patchwork-Id: 872236 Received: from zg8tmja5ljk3lje4ms43mwaa.icoremail.net (zg8tmja5ljk3lje4ms43mwaa.icoremail.net [209.97.181.73]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 514E02253EC; Mon, 10 Mar 2025 09:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.97.181.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741599592; cv=none; b=KwyUDV90Ux82lgQXOeuRxDa0wkj+obQlXSaHoD09nYfUfbqtIoO9lRwUv/L0NPexQV7ktci1KUgK+z7yGplRphLBYebkm2iezyiq9RxNyzBPaMN4sLR3r1TrIpns+tNj4pitK077WDlFEAjmuPeciK4Ga/7ZGvrjlZ6nOu321No= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741599592; c=relaxed/simple; bh=mXEXXWZhTAy6Xgv9fTXo+ptxJ2X1MjYFV3t3jQa9mjg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=O8i8gqbxoKxi8/BIg+czaB3FtIJJCOHZ472Y5jBpd0M1j6a38XVXyeSQEyqTPcNi5hxuroSsXfgXvMxpLg8sZnBCXQy353x+IJFzEkyzPTL7MPH1ocIQ+vXhVhPgr4X06bzcNRtTVKA88FihtAfEE7o8pnMzCXFWxrtk+1sKLUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phytium.com.cn; spf=pass smtp.mailfrom=phytium.com.cn; arc=none smtp.client-ip=209.97.181.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phytium.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=phytium.com.cn Received: from prodtpl.icoremail.net (unknown [10.12.1.20]) by hzbj-icmmx-7 (Coremail) with SMTP id AQAAfwDX3k5Us85n9g9PCA--.19023S2; Mon, 10 Mar 2025 17:39:32 +0800 (CST) Received: from phytium.com.cn (unknown [123.150.8.50]) by mail (Coremail) with SMTP id AQAAfwBnZ4NRs85nV6ZBAA--.19172S3; Mon, 10 Mar 2025 17:39:31 +0800 (CST) From: Yuquan Wang To: rafael@kernel.org, lenb@kernel.org, Jonathan.Cameron@huawei.com, dan.j.williams@intel.com, alison.schofield@intel.com, rrichter@amd.com, bfaccini@nvidia.com, haibo1.xu@intel.com, dave.jiang@intel.com, rppt@kernel.org, gourry@gourry.net Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, chenbaozi@phytium.com.cn, Yuquan Wang Subject: [PATCH] ACPI: NUMA: debug invalid unused PXM value for CFMWs Date: Mon, 10 Mar 2025 17:39:10 +0800 Message-Id: <20250310093910.1752126-1-wangyuquan1236@phytium.com.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: AQAAfwBnZ4NRs85nV6ZBAA--.19172S3 X-CM-SenderInfo: 5zdqw5pxtxt0arstlqxsk13x1xpou0fpof0/1tbiAQACAWfJ-yEJJwBCse Authentication-Results: hzbj-icmmx-7; spf=neutral smtp.mail=wangyuquan 1236@phytium.com.cn; X-Coremail-Antispam: 1Uk129KBjvdXoWrZrW3Ww45JryDKr45XryUGFg_yoWDJrb_uF Z7ur4xJa12gF4I9wnrtr15ZrWvyrs7uFykZ3WSqa4Fka4kX3W3Ca1Yv3sxZr15KF1fGFs8 Ca98AryFyr4fZjkaLaAFLSUrUUUUnb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrnU Uv73VFW2AGmfu7jjvjm3AaLaJ3UjIYCTnIWjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRUUUUU UUUU= The absence of SRAT would cause the fake_pxm to be -1 and increment to 0, then send to acpi_parse_cfmws(). If there exists CXL memory ranges that are defined in the CFMWS and not already defined in the SRAT, the new node (node0) for the CXL memory would be invalid, as node0 is already in "used". Signed-off-by: Yuquan Wang --- drivers/acpi/numa/srat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 00ac0d7bb8c9..eb8628e217fa 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -646,6 +646,9 @@ int __init acpi_numa_init(void) if (node_to_pxm_map[i] > fake_pxm) fake_pxm = node_to_pxm_map[i]; } + if (fake_pxm == PXM_INVAL) + pr_warn("Failed to find the next unused PXM value for CFMWs\n"); + last_real_pxm = fake_pxm; fake_pxm++; acpi_table_parse_cedt(ACPI_CEDT_TYPE_CFMWS, acpi_parse_cfmws,