From patchwork Tue Apr 30 09:21:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648613 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2051.outbound.protection.outlook.com [40.107.101.51]) (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 A54701A0AE0; Tue, 30 Apr 2024 09:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468953; cv=fail; b=nliXvBu/ZKNbHFNns2bp7ql6N5OPZ3iySd/hX9EmNes9y/E8IVrs1eaCp9vPn5arYzO0c6kAmRoV6iDCo4eYyw5B5a7wtqWjO9A1uyn1O8WGy+P369v8Jv0MOqLPM7h6gd2ixcV3LXDsKwH0zqiha32kH5y5oELs4KlgCzQKyV0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468953; c=relaxed/simple; bh=SIYEEElKuNiNg6p8LKxSLm/beuI9GIhsW32SbcLMK/k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=drLspRc1tbjKztqNfpWuQ5vTyu56XkeAvtg88E+7vRmMWU69ltDglQL8eXGz7TUtD4RM6WlqXf1CSDHS9+yL6QbtMUx7bkGD1aZsebGFV1VIdGO5HwbkovVuFW4dBAU9AI32Ws3TLuwR8VJHg5YMgeTXnGHp+d6bLxgZavGAYCw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ZMgbyegc; arc=fail smtp.client-ip=40.107.101.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ZMgbyegc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XE341uuqXIOl+CGx91aXyRAolPCoCGIZi1p87vAFQnvEyTjYM3gXeMBEPewl9+HHp53BW8asytjAWiemNoGzQ+gRpD0/F7MMOv15npnuFNomj8331ryjdad9WKo/lNP0vJci1Rxcw6TmnLgqPO0GTNncGba6GhyRKJJ4MgEDFBj0QlHbPugdIl6chx+kxKXS8bWOLlrNbmNGMU9eZ7O1uvj0re9IzO7pOj0S6ODSFF5qlU1JR1Bg6q9/t1/yTZVN5EuA92KOJbWxrTV8lNY2ce+hMxGouSLmBnflfVJb69Qku1fLCYQN6Hdv48ItVyp8Lrj2PLc7e+SQpTb+uyFWDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wdhZDafrpMV2qpF3fVdIuPSmWqxpJHX2I2fP4tJiH9k=; b=Mg2WL+5C4JIE7qh6PQOBN4P/L/FRTa06puca/ltp0SEm1cyCpJjtzCosbITImJuksuo0pJkLcVMr9EInN4DF/VeTYFWFIMy5ESio8pOOAnNomSdNrSrgShmGuDqNUSKmnF996CAp2Y59fp6isYi300A3QYCjSkVVYj5in+ww8+9R6XDHwc3YsXxWPA8jPCNKbgM4klK4pVxF3BmNNbmlyOXOG616w2TDnn44hIVPBfb+TZEGQ9YWajn3XkFtERtoXTQSpTehyaVXuMpYmtGuSVZu0vqHK/01Cz5j3+FrlO6UdGqx76utx9FI98pPaaE34GvE4QR4HIxSvWNZuffyXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wdhZDafrpMV2qpF3fVdIuPSmWqxpJHX2I2fP4tJiH9k=; b=ZMgbyegcL9q5I6hz3sl3QNU5sgtGvyz0MlkAneS5B+UxjBFMYUrTVCu+QvipUMgLgs9JSkEXd1coBDM6H4386iFcrpuI3lxZVkKCyZO3YMzM7/ZeMwDNs4dw39omEPSLyH84dysFT89PrWhh7s7XraLolXwpygcmQISE5BMtZ4c= Received: from CY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:930:17::19) by DM4PR12MB7624.namprd12.prod.outlook.com (2603:10b6:8:107::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 09:22:28 +0000 Received: from CY4PEPF0000EDD6.namprd03.prod.outlook.com (2603:10b6:930:17:cafe::32) by CY5PR17CA0030.outlook.office365.com (2603:10b6:930:17::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36 via Frontend Transport; Tue, 30 Apr 2024 09:22:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD6.mail.protection.outlook.com (10.167.241.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:28 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:22 -0500 From: Robert Richter To: "Rafael J. Wysocki" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , Andy Lutomirski , Peter Zijlstra , Alison Schofield , Dan Williams CC: , , , Robert Richter , Derick Marks , "H. Peter Anvin" , Len Brown Subject: [PATCH v6 1/7] x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() Date: Tue, 30 Apr 2024 11:21:54 +0200 Message-ID: <20240430092200.2335887-2-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD6:EE_|DM4PR12MB7624:EE_ X-MS-Office365-Filtering-Correlation-Id: b170ef48-ec2a-4b45-2dea-08dc68f70e0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|1800799015|82310400014|36860700004|921011; X-Microsoft-Antispam-Message-Info: o6txoVJG4P3FGDTLxo9WwzMy63YGCGL6TfQoI8mynxNG73+n60dw2q1Uq8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L+fSEQLixhA6yoGL8UVzT+wHIbJXSDaw9JJiQnHZtxY8rHjEgu9BxzO+d3vERlHPoRMcM4tl8B7CkZXEMfSpv50CQizTSiexR8Y4NJhk1kcdnHKd423C+gM2bSRrXmGs7/NzSPxCws5vIvAo+evFPwfoOqMsebu6P6nJF8VVHa7J/R8JjEx2vDJbulz+fhVBTj0xw5VgQgVIJgXIVnJMd27jTuHTStky1lqUK+2J3lcug== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(7416005)(376005)(1800799015)(82310400014)(36860700004)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:28.0760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b170ef48-ec2a-4b45-2dea-08dc68f70e0f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7624 For configurations that have the kconfig option NUMA_KEEP_MEMINFO disabled numa_fill_memblks() only returns with NUMA_NO_MEMBLK (-1). SRAT lookup fails then because an existing SRAT memory range cannot be found for a CFMWS address range. This causes the addition of a duplicate numa_memblk with a different node id and a subsequent page fault and kernel crash during boot. Fix this by making numa_fill_memblks() always available regardless of NUMA_KEEP_MEMINFO. The fix also removes numa_fill_memblks() from sparsemem.h using __weak. From Dan: """ It just feels like numa_fill_memblks() has absolutely no business being defined in arch/x86/include/asm/sparsemem.h. The only use for numa_fill_memblks() is to arrange for NUMA nodes to be applied to memory ranges hot-onlined by the CXL driver. It belongs right next to numa_add_memblk(), and I suspect arch/x86/include/asm/sparsemem.h was only chosen to avoid figuring out what to do about the fact that linux/numa.h does not include asm/numa.h and that all implementations either provide numa_add_memblk() or select the generic implementation. So I would prefer that this do the proper fix and get numa_fill_memblks() completely out of the sparsemem.h path. Something like the following which boots for me. """ Note that the issue was initially introduced with [1]. But since phys_to_target_node() was originally used that returned the valid node 0, an additional numa_memblk was not added. Though, the node id was wrong too, a message is seen then in the logs: kernel/numa.c: pr_info_once("Unknown target node for memory at 0x%llx, assuming node 0\n", [1] commit fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT") Suggested-by: Dan Williams Link: https://lore.kernel.org/all/66271b0072317_69102944c@dwillia2-xfh.jf.intel.com.notmuch/ Fixes: 8f1004679987 ("ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window") Cc: Derick Marks Cc: Dan Williams Cc: Alison Schofield Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Reviewed-by: Dan Williams --- Authorship can be changed to Dan's if he wants to but that needs his Signed-off-by. Signed-off-by: Robert Richter --- arch/x86/include/asm/sparsemem.h | 2 -- arch/x86/mm/numa.c | 4 ++-- drivers/acpi/numa/srat.c | 5 +++++ include/linux/numa.h | 7 +------ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/sparsemem.h b/arch/x86/include/asm/sparsemem.h index 1be13b2dfe8b..64df897c0ee3 100644 --- a/arch/x86/include/asm/sparsemem.h +++ b/arch/x86/include/asm/sparsemem.h @@ -37,8 +37,6 @@ extern int phys_to_target_node(phys_addr_t start); #define phys_to_target_node phys_to_target_node extern int memory_add_physaddr_to_nid(u64 start); #define memory_add_physaddr_to_nid memory_add_physaddr_to_nid -extern int numa_fill_memblks(u64 start, u64 end); -#define numa_fill_memblks numa_fill_memblks #endif #endif /* __ASSEMBLY__ */ diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 65e9a6e391c0..ce84ba86e69e 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -929,6 +929,8 @@ int memory_add_physaddr_to_nid(u64 start) } EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); +#endif + static int __init cmp_memblk(const void *a, const void *b) { const struct numa_memblk *ma = *(const struct numa_memblk **)a; @@ -1001,5 +1003,3 @@ int __init numa_fill_memblks(u64 start, u64 end) } return 0; } - -#endif diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index e45e64993c50..3b09fd39eeb4 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -208,6 +208,11 @@ int __init srat_disabled(void) return acpi_numa < 0; } +__weak int __init numa_fill_memblks(u64 start, u64 end) +{ + return NUMA_NO_MEMBLK; +} + #if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH) /* * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for diff --git a/include/linux/numa.h b/include/linux/numa.h index 915033a75731..1d43371fafd2 100644 --- a/include/linux/numa.h +++ b/include/linux/numa.h @@ -36,12 +36,7 @@ int memory_add_physaddr_to_nid(u64 start); int phys_to_target_node(u64 start); #endif -#ifndef numa_fill_memblks -static inline int __init numa_fill_memblks(u64 start, u64 end) -{ - return NUMA_NO_MEMBLK; -} -#endif +int numa_fill_memblks(u64 start, u64 end); #else /* !CONFIG_NUMA */ static inline int numa_nearest_node(int node, unsigned int state) From patchwork Tue Apr 30 09:21:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648614 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) (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 24FBD19DF76; Tue, 30 Apr 2024 09:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468955; cv=fail; b=OaZ4nF5uymnHvAGx7ol3VHL030aONzQqZoEwhmcVKeaBoAN9Py6CEtwtquNh2cNnJyKT8M3pMC0v3x99O5fTh5DeWsIeBH5MPPXMu8q44vOjkh0UVu7O5Q+6REOjzfGDecYePUeMXs747/8/L8k2/w+DxWnkb8m1fIuAU6iSjp0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468955; c=relaxed/simple; bh=647u1z3wRbEbaOeS0NL+K0zW6YDbrE4mrsl+FRUBytA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G0q44wSqflItSEPVfx0e2GymkL0hXFiHXlTujRGbFuMZVT0qXsT0jrEW2HEkBV1+UNyN7/Ng6c+2bXsGy0ioaTaQ8k2KquVtyi4Nj6R5iiOM1KSvqq0qPI6qVoYliDJjC0fNmL/4GECdI3O56S7f6SJyEvdrcMpIxmKcO4ES8Gs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=pN+7Ibzh; arc=fail smtp.client-ip=40.107.220.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="pN+7Ibzh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R6q5LHws0ZZ+SO2KfHacdoVx+OtEUGBL7mbGtVKpCV4k5WqTmAGRn10ynQ60pIUBFack6T4f7uR+jjGTHJth/trecDWQkBluFYonKBmZiiDK8srlMWKI07wVi5ggpddo7tKhE1UtI/pujE6qcAwLjDBNxtzs/xERnZduNXBo+B1iPMMZHNSEti+RICk5QRurtmT8SgKoZbG6kEU4UQHUvjocQ13ZiWxUEUO7ybll6xmoQTddS3xZwHk6rmj+ynA0qNnVNH2EbNiyoO4FGpCXdiRKL1r3U1PWRNOhr3Bxjny2g8hMtnYCduskQNCedjFksQS33sn5lLxPytHg6/2Vrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Rbiu9B8dMh2GCmUdkxKoTB+BVLOyjvHNhJoJbm+eYlg=; b=OjIwK+DqHo9DwHgUPyzkG20u6BUcyZa9w6Qg/rE2xcCEeP4ysmeWeWK5nO/ehZMcQhQ/pD3kBCdpeUF9F/5GB+shDQ2qVs9YWCLalo00R3lx6swd6rehKAG/42pVypDHSIMLMlict6kCHMifMj5fHp4RQ8MYxxCqrLwlY5G/Tlb+5IZ/OiwaAmZALQS1OOVv4+EXsdy4ba38kGA0PchyQNJhEArTiYprP7OwXaHdXJbsFOFXN/3vB/NiTU1Nfc0+3MSl51LqtNaG9hLgClJSmDno3yIe5gi1i6woeW7t0Jbxf7jKnD6UqAcq//xINunCJ2FZMLnyXK58Bb4++wchLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rbiu9B8dMh2GCmUdkxKoTB+BVLOyjvHNhJoJbm+eYlg=; b=pN+7Ibzh7YHiFA6HUeRzncQo+KPnowFnrNxtURNj43wbWtBMZcLqI8e6JDx76TiS+q6Je37Zi0J2jG4JivLRtUf2a9znhV2EMoQnPD2uBsE783sg5whgScNo22pOIPZh77ty5RtXxaY9ElMBwTzH2OeZACq/6bLajEahBUPTEEM= Received: from CY5PR17CA0013.namprd17.prod.outlook.com (2603:10b6:930:17::34) by LV2PR12MB5918.namprd12.prod.outlook.com (2603:10b6:408:174::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 09:22:30 +0000 Received: from CY4PEPF0000EDD6.namprd03.prod.outlook.com (2603:10b6:930:17:cafe::ae) by CY5PR17CA0013.outlook.office365.com (2603:10b6:930:17::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35 via Frontend Transport; Tue, 30 Apr 2024 09:22:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD6.mail.protection.outlook.com (10.167.241.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:29 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:27 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v6 2/7] ACPI/NUMA: Remove architecture dependent remainings Date: Tue, 30 Apr 2024 11:21:55 +0200 Message-ID: <20240430092200.2335887-3-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD6:EE_|LV2PR12MB5918:EE_ X-MS-Office365-Filtering-Correlation-Id: d456b1b8-15da-4192-5cb3-08dc68f70f21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|82310400014|1800799015; X-Microsoft-Antispam-Message-Info: m2Q+RCMB8cr9yOJKZIDkY5btF2gXAf8INSUmagj5WbB6FnO/n+ydE9rSP76hQSmvxQ9YexYXyCySY+7kPSktVyo6BM6nY2GtIqa7ZbZES11gBXwjmF1s+OyPJ/5PHCmKaBWLzAHgyEdQcrFvW0J6OID0e1Rp2bTmpUITPA4+K5WhgYKXi7LQ2Bn8t+9LBR5qpysJ73uO/GaYk6/l0dbARTSqYH9rq2Fp3qcf9S8ToeKmxtbt+2kNCs9ANbwWdMrTg2pTjaM4VQi/8yiJwXxc2nSu2xhTH9c6vmaYp+gfn5Lq/c16zHk6uEUoD3ev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IdLYUPe2bHNWMIWURJgYjB7em X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400014)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:29.8885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d456b1b8-15da-4192-5cb3-08dc68f70f21 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5918 With the removal of the Itanium architecture [1] the last architecture dependent functions: acpi_numa_slit_init(), acpi_numa_memory_affinity_init() were removed. Remove its remainings in the header files too and make them static. [1] commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture") Reviewed-by: Dan Williams Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield --- drivers/acpi/numa/srat.c | 16 ++-------------- include/linux/acpi.h | 5 ----- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 3b09fd39eeb4..e4d53e3660fd 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -213,13 +213,12 @@ __weak int __init numa_fill_memblks(u64 start, u64 end) return NUMA_NO_MEMBLK; } -#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH) /* * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for * I/O localities since SRAT does not list them. I/O localities are * not supported at this point. */ -void __init acpi_numa_slit_init(struct acpi_table_slit *slit) +static void __init acpi_numa_slit_init(struct acpi_table_slit *slit) { int i, j; @@ -241,11 +240,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit) } } -/* - * Default callback for parsing of the Proximity Domain <-> Memory - * Area mappings - */ -int __init +static int __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) { u64 start, end; @@ -345,13 +340,6 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, (*fake_pxm)++; return 0; } -#else -static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, - void *arg, const unsigned long table_end) -{ - return 0; -} -#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ static int __init acpi_parse_slit(struct acpi_table_header *table) { diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 34829f2c517a..2c227b61a452 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -242,9 +242,6 @@ static inline bool acpi_gicc_is_usable(struct acpi_madt_generic_interrupt *gicc) return gicc->flags & ACPI_MADT_ENABLED; } -/* the following numa functions are architecture-dependent */ -void acpi_numa_slit_init (struct acpi_table_slit *slit); - #if defined(CONFIG_X86) || defined(CONFIG_LOONGARCH) void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa); #else @@ -267,8 +264,6 @@ static inline void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { } #endif -int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma); - #ifndef PHYS_CPUID_INVALID typedef u32 phys_cpuid_t; #define PHYS_CPUID_INVALID (phys_cpuid_t)(-1) From patchwork Tue Apr 30 09:21:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648615 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) (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 811071A0AF3; Tue, 30 Apr 2024 09:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468957; cv=fail; b=iNfSPi3YfhWB5yetsrWMvH+fJAG2cS+ELjLUqL5Nzq+DuyZN/7K5s2MY1OhZ0ls+XZvtbKkoEbKxmU59DK5D/MwQUAecjy+KDzisutjzOhUX7uowk3BQLiTaIOfDusIoWmgesXdO/159u9dWXMEwhzVtk3oy8c2+xNrd06rEfeQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468957; c=relaxed/simple; bh=3A0QL/Q2ZLGYAxVW0jdhOQ0VW3DumNN9kZB9MQttzwQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dD11klyiJf6Av4xyusibjW6qSSJGVRct+W7UvpnZ+43NkWMqcKG1PctNwUrnFRPMXnz5W8fRZJuJZNATMsLEqe8BY1KOlV4YCxvtpduCBObKlfMhJr7D3FnhBbsqVeK2VxanBM1x28pihwCVFDzbayUrTCmpTvC1YaRqwJ+gSFI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=P3tbYBOa; arc=fail smtp.client-ip=40.107.237.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="P3tbYBOa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VWlL/cXvesapUB1/9Xr57kwG7wsptHbaM6lnIANuIHyGKpcoWEPNlfTF+r5dNSVEtklLx8Aexa7WpqP0rSEwncYu1p8JCdgeA8GJnGRj1SwjAzQMFyClk2HeNSG7pNpHuuSdd1t1rpKXn/vmTB1VU+DB4GK9Ltkzz8kGVSIa4ShfxNekeXpqowWGqGdTAReiSXEcqICERdoW6mMGjDL741L2WcclwhDK5pFiRI/gTBbkkyrtvFlcTMEGqOFiOAaIXY8EfqlofhqUIoQFVNROtqIrQBsJSujUHiyIkSOqs08WK6PSmuk5vi/bP/POvGNbXnXpsS0vBitd4iKBzX3tHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6UISV2JCdeG71+wO8w7lSn249sa+w/Qr4NBQ9V5O2Ko=; b=fUB6O/2hndEfUMmOPbU5WA4u8Y1tAcDAzrhRYKNPkf6gJeZsalQZ0YGsUguW3Tq01iNTu49Prc/KL1DIvzVZuQUSqc3VP9d+iduD3MEg+MFqMpp53mhe9yEHd7ZXqNlgMw05Trd6pU9JfdBaijHvfQuaqTmURbM/Dr6IhBGLbEhluUxWFlahww0YsBtoTkexuTQAxI0IXZhMos04nmCqMlo4mmPI12wxob5hdRpz8SKpxSSNs9SYFNNSSzoSZX1++l9/Me4v/kt7p9C2Vfm9aPWnX0qd1WNs/x3rQTAhlEWimOrCFDOmvuFJtJhIzD6rYtV7/vblLqNo5coqpwlH8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6UISV2JCdeG71+wO8w7lSn249sa+w/Qr4NBQ9V5O2Ko=; b=P3tbYBOaoi/tOMScMElqTjZShO2R0PIiLriEIf6kkfqGWbTiKzYnFHjjDXAHit/o6l49A5cPTpQeh4NuK7wym0/DU0D3Hn8Btd0hKNxZSRmyQKIKKU+pCQxZxdtkl/w8WFUK85oTjLUY4jS2AMBMPTOZcpTGucU1tJ1ePfuiKHI= Received: from CY5PR17CA0025.namprd17.prod.outlook.com (2603:10b6:930:17::16) by IA1PR12MB8192.namprd12.prod.outlook.com (2603:10b6:208:3f9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 09:22:33 +0000 Received: from CY4PEPF0000EDD6.namprd03.prod.outlook.com (2603:10b6:930:17:cafe::1b) by CY5PR17CA0025.outlook.office365.com (2603:10b6:930:17::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35 via Frontend Transport; Tue, 30 Apr 2024 09:22:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD6.mail.protection.outlook.com (10.167.241.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:32 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:30 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v6 3/7] ACPI/NUMA: Squash acpi_numa_slit_init() into acpi_parse_slit() Date: Tue, 30 Apr 2024 11:21:56 +0200 Message-ID: <20240430092200.2335887-4-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD6:EE_|IA1PR12MB8192:EE_ X-MS-Office365-Filtering-Correlation-Id: 828bdfa9-6785-4915-20f8-08dc68f710eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|82310400014|1800799015; X-Microsoft-Antispam-Message-Info: tPhTS9om0ThfXe2ZKiixnTEcSABEkFEVj5LJ8gim8FfOE0e8vv6JBlLyMKhFADQq0f+i2rcZMGlIxogapqgL+11DIVAeYoRmS8IN/H1XVPntqEai/J4/+DFIm3ZyXxYcNTGKMYZ6bHtaVIK+KeQ1aENOLK2R0K8RlQ39aOWxxAIlgXwm40SB86k1Xo5IXAZ6sRNrwmH1wSmN2JBmpoJW271CqP5tR5G5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m/3CgmaQi793zhWlvtjH7PUpWAJzThQwSK1lLIaB8s80cAr4anloBOSPQU0FQ1eAWifwElBtcjqzi8cnk= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400014)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:32.8886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 828bdfa9-6785-4915-20f8-08dc68f710eb X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8192 After removing architectural code the helper function acpi_numa_slit_init() is no longer needed. Squash it into acpi_parse_slit(). No functional changes intended. Reviewed-by: Dan Williams Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield --- drivers/acpi/numa/srat.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index e4d53e3660fd..430ddcfb8312 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -218,10 +218,16 @@ __weak int __init numa_fill_memblks(u64 start, u64 end) * I/O localities since SRAT does not list them. I/O localities are * not supported at this point. */ -static void __init acpi_numa_slit_init(struct acpi_table_slit *slit) +static int __init acpi_parse_slit(struct acpi_table_header *table) { + struct acpi_table_slit *slit = (struct acpi_table_slit *)table; int i, j; + if (!slit_valid(slit)) { + pr_info("SLIT table looks invalid. Not used.\n"); + return -EINVAL; + } + for (i = 0; i < slit->locality_count; i++) { const int from_node = pxm_to_node(i); @@ -238,6 +244,8 @@ static void __init acpi_numa_slit_init(struct acpi_table_slit *slit) slit->entry[slit->locality_count * i + j]); } } + + return 0; } static int __init @@ -341,19 +349,6 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, return 0; } -static int __init acpi_parse_slit(struct acpi_table_header *table) -{ - struct acpi_table_slit *slit = (struct acpi_table_slit *)table; - - if (!slit_valid(slit)) { - pr_info("SLIT table looks invalid. Not used.\n"); - return -EINVAL; - } - acpi_numa_slit_init(slit); - - return 0; -} - void __init __weak acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) { From patchwork Tue Apr 30 09:21:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648616 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2050.outbound.protection.outlook.com [40.107.95.50]) (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 6891A1A38EE; Tue, 30 Apr 2024 09:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468961; cv=fail; b=XKBWvqzpRecsxSnzBdXd11+4cqIgfJh5Oz8WjTGDrCWxHx0VovMgK0pnlYGYMrhpsyvv9xapYUx650RgBlpzSL//ZzpwQr3DeYSkuG3Uo7+eOjCeQ57AzEd4H6eJYF8LmVoJ4ng4+bf1RfvAAJWJKpfZpf0AwWkJxFoUp4pyDG0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468961; c=relaxed/simple; bh=GGVOQyQcshRXGn7vgXDtIcG0ullrNrrKkucC9HaihuU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cd0wUti09og37LS3FE3qeB4KeHCVt7reNWatAbq4rer0u51qds0ZBksJT/YGMJRphDoWu+iNm8sLiO1lnGgI/tallagjq1GgdqV4hrcsEBH25H5ZTBq2YeqOh7gCKAzz5z+tYYJJLFV6ad3tCB/v4mceXtUueXTTvPTQBlCotbQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ao7k59RO; arc=fail smtp.client-ip=40.107.95.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ao7k59RO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UvRZivYsFDVjn/0DtzDFKhJIJL5yqBso2k5t5axrKlUv9SO60U9Y0NjCOKr5lcHN33zk0vzes9aWjUakDgdE9tyZgS6RAo0QRYKgcZ5VMGnFSFhXomU5GpdJpMgvG+XTjwzgADRvtct6Oumq8LC4Z3gdloxaO78RwLaJikFQRGBRNlsmYK/FJxI2UZ4Gj6tgueQ/x6Bq5UmA215d48V57G3oLnGBm09Xday/lHtKsqCpBGln8jdO1tOa+UHFS45mJZw88FsxZDSbUmwfs6vsksEa29j3b1TOLR4JnECvKF4EbCKK923bo8kJPvZx01sxkN7plTjNePFsjVhRK9QRDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rkL7D3UE3FQj+F2O0O6sABtRz51PmXjFWY+kdAxvrYk=; b=gyfcZYjjsW6RdJNlQGvjntBLabRhe4j8U5tBpR5d2F0d0/NmSuggief74tDas4+skv3y3APK9lu72N1k40u8pvc2bCc8G4qBO3BmiOxphdj5chxcYvnNOjWFr+ODvSRqQqji8nacr4kzJws9BZDOr46Z2LWVwBWaZxM4J3b0pK8//5CFsFx+wg74VwuG22IlvUBSGE2NRMfAFnWliYq1K+/454OiWdwOWc/oxGJ7er08nqsAY3Vh/r73SQuGElUnIdnjTo21jxGr1Iz0xTlJsSUcyvZdGdHYYm/gEq1DetufxGK13Fwaxv5krwzJaZLoBkbd2ou7Ga7wQk/95MBxKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rkL7D3UE3FQj+F2O0O6sABtRz51PmXjFWY+kdAxvrYk=; b=ao7k59ROnXmUW8AbQ+yy24I+lzrGuzi1l+FKtVH6c4LAyclYri5krKzJqZ2Hi/9l81Lc3/+u7xPONwcuOINY1sBTlHb4zgdDDTvNxUBoClir9agpbddfjvMIsn7RhJo+gFVRPSCC1Arf/hfk9a4DS9rUgyFtvT7CMZEJg1eXHmU= Received: from DS7PR05CA0028.namprd05.prod.outlook.com (2603:10b6:5:3b9::33) by IA1PR12MB8519.namprd12.prod.outlook.com (2603:10b6:208:44c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 09:22:36 +0000 Received: from CY4PEPF0000EDD2.namprd03.prod.outlook.com (2603:10b6:5:3b9:cafe::ad) by DS7PR05CA0028.outlook.office365.com (2603:10b6:5:3b9::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.22 via Frontend Transport; Tue, 30 Apr 2024 09:22:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD2.mail.protection.outlook.com (10.167.241.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:36 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:33 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , "kernel test robot" , Len Brown Subject: [PATCH v6 4/7] ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity() Date: Tue, 30 Apr 2024 11:21:57 +0200 Message-ID: <20240430092200.2335887-5-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD2:EE_|IA1PR12MB8519:EE_ X-MS-Office365-Filtering-Correlation-Id: 3eda927c-a4bc-4ec5-13bf-08dc68f712f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400014|376005|36860700004; X-Microsoft-Antispam-Message-Info: Ouj8wz3jfWNKd2sNfo+UZhw7Udrh/ejI1kUK638R7lVusgJz2qLWtC3NEC5ZtooWBkcVgn5+I6VmRyYQNfHztNZOYquIQXhP3u68rgFm6J6N0b1nPPYm+fxAXDlPweMhFG5Q8jvMKN/zoLlYPNxsgXsoWk6JbJIDTVftYaayusir6Cb7LPc1p1JwHtrN77c7kbnMbuTcojZhTa7b9YIFmeGc98UzkprGYmX9fZgbEjtHOvo2clDhzEpzBNd571bUQBY5Tnoq89unIDKZuV74xd8TTC+iFnRLp/KZu14aAjdLakdt8BYie8exe5w9kRVIxKKKrPQ+0yfqvemyU3Vr4riHty4iqOLOu4AFza0grwn2chbtZSL1Ej8eaiUWAPNGv4CnrFLtgDtiiYCA9m10QdUM49y676S8Hs3WlP8CHDzjpO9ocMiieimk3ORdCXQZTXrIM0aDcX8xEohzJaZwmQq4UmiIdnWBEkjyMG0vwPjfwoZ7pff8J7SRPlJBdmSU/g2OyyUo7vfkhEJYtYVyB446SK+T7sx8BIdDgB4GYMQzCs8JL8WEq/jU5JGaq1h7kkGyKw7kRZlPBkFOOOecJgH2p9SL9RtR18okxdhk4hkdodOwD4zSqWIyiaIBaHSI9uYmc4XfVgbyVrC/fyIeV1yDS+9gRd3h6GdFyAEUn9yWDU388hcC4WBhWq5JdJ7OGe72IQtSm/AWa9zCOcYlTi6j/G79BPSRFD3854xIbfsNJzQ9za8FDKbCNIlEfeB7V40xisCM8XmCzvPl1nQknPmyA9UzahnbjNawhAZs5PEou2Onseut6jgmlFtsyZdax8oSTSnAnwdywkcxOFPG7jGnLwcKJPgTQL0YnDDWdqf9moMnx9Vi+cC7fnK3YmZ31wkIcOMERkWJGUvuOdGsIwEu+0S4kIdmlo+yp4dz7OinVV+WJqVtm1il3GvChZgrH6kkDz0jdd3n7yTRxjap3FiubLVTvnNnxmsbEyy4R4sio5bNFpbrAZXv+3qEVPt2ULEcHcnv/TKTNqaIX47hjK0g0UPIgAenst3a4Q0PayB6wyIXJrB56P6rfdBZ78kLTWGvkKTdQ/ABCnWooFYFIkwJQzu5QLZfG20o3N7Sxg1CW1dRgyMT4anxiX7lLkGB0cIjAO5C6bennVSGGRWVwIL82EwctnwaeVh7Jp5h1ox4RXx9FRtzDtZR2D8tczmGXhmyPRJRg6Qe6uicNhxKjffR5HEP1+syVk6Grz+kxge5HMAidGg2fdp2mcP8yhcRzdCR3GZK1hsPcGBLSOPAwcBoMvLEb6hyROGOSzVVe/ZrHqEVj/XrhE/pADCczThu X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(1800799015)(82310400014)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:36.3001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3eda927c-a4bc-4ec5-13bf-08dc68f712f6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8519 After removing architectural code the helper function acpi_numa_memory_affinity_init() is no longer needed. Squash it into acpi_parse_memory_affinity(). No functional changes intended. While at it, fixing checkpatch complaints in code moved. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202403220943.96dde419-oliver.sang@intel.com Reviewed-by: Dan Williams Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield --- drivers/acpi/numa/srat.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 430ddcfb8312..e3f26e71637a 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -248,22 +248,30 @@ static int __init acpi_parse_slit(struct acpi_table_header *table) return 0; } +static int parsed_numa_memblks __initdata; + static int __init -acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) +acpi_parse_memory_affinity(union acpi_subtable_headers *header, + const unsigned long table_end) { + struct acpi_srat_mem_affinity *ma; u64 start, end; u32 hotpluggable; int node, pxm; + ma = (struct acpi_srat_mem_affinity *)header; + + acpi_table_print_srat_entry(&header->common); + if (srat_disabled()) - goto out_err; + return 0; if (ma->header.length < sizeof(struct acpi_srat_mem_affinity)) { pr_err("SRAT: Unexpected header length: %d\n", ma->header.length); goto out_err_bad_srat; } if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0) - goto out_err; + return 0; hotpluggable = IS_ENABLED(CONFIG_MEMORY_HOTPLUG) && (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE); @@ -301,11 +309,15 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1)); + parsed_numa_memblks++; + return 0; + out_err_bad_srat: + /* Just disable SRAT, but do not fail and ignore errors. */ bad_srat(); -out_err: - return -EINVAL; + + return 0; } static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, @@ -438,24 +450,6 @@ acpi_parse_gi_affinity(union acpi_subtable_headers *header, } #endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ -static int __initdata parsed_numa_memblks; - -static int __init -acpi_parse_memory_affinity(union acpi_subtable_headers * header, - const unsigned long end) -{ - struct acpi_srat_mem_affinity *memory_affinity; - - memory_affinity = (struct acpi_srat_mem_affinity *)header; - - acpi_table_print_srat_entry(&header->common); - - /* let architecture-dependent part to do it */ - if (!acpi_numa_memory_affinity_init(memory_affinity)) - parsed_numa_memblks++; - return 0; -} - static int __init acpi_parse_srat(struct acpi_table_header *table) { struct acpi_table_srat *srat = (struct acpi_table_srat *)table; From patchwork Tue Apr 30 09:21:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648617 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062.outbound.protection.outlook.com [40.107.94.62]) (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 CCCDE1BED72; Tue, 30 Apr 2024 09:22:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468964; cv=fail; b=gXDMSOZk5naLum0eTY2Jxc38mF+HEsD8iVzhhyc+Ur3W52LU4tApAJ1pNzByTph/MqOQYlyVfPF14izEl9q83BsV8hr5P0EXedaBdgGFdFNhmFMENsofZ2vxYOd2/KVCBeSF8QM+0IyShxQ/3wh83lgoJ2EvZzCXpUwLm+LvDLc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468964; c=relaxed/simple; bh=Ue8WH4C9GLmmniw/cZeViaqoValVaj+Q6uEWMvcoUPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z7vZyjSkG5K5G6BKOHLQiRBjojgMMREsNBxRfRYe10kRIzHDjtnMoYzPJVv8VJFtnYY7Qc1XeudDSGYOycfUCwKs41D7NaWif02DIzOzc1BmFiaCTKhtvsRk8eL75GZjVmfOzx4+gtrUvI1EfvRShETeiTfWdEEpRCopK6HoFEg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=uPvZxUmK; arc=fail smtp.client-ip=40.107.94.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="uPvZxUmK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=STPU+Ff1rYUlogWZRlZBi+JL0YLk1pZPz/rfgls+zpNkmhN0EDA6XmkXil+e7PM27EcUU4w59B5vsZDjc51hTBieKB1qJflOxiFeD7Jotj9F+2973cl7OFUUyLLvhcv8NNt4cz61D+ZF1I6kerITy/D2TMaJMxNJ8p9j9tBZv3maSY0Y+trE9P9aFd+xvVAQKh7k+cOzCAyPSzB4qlemJnvInxdRhfRpTCi632CJLsjqGf6J8KToWYdkh9dv8lfFwQuvf+3DK7s/4krC4v0e2rHtva3zG9hp4s+zxKKjWORKfswUmkDcLMJRRf7DZ32VH157F7WpvVIep7MNYjPZyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WYa3HjH45tLeZst82FHqztgFJXWtI4K9z4B5DEry0aI=; b=gIL0wyR0pFVedv2f2AAuoP2ED+nJq1HOpI/w7ed0/4SsIpZFd8DwtbZ7S7uU02dcAPBfuuF5ynlv0VXIAJMCXY+lmcCaS5Oa/ByDmskHPKdsoG/rttarMiZWSvxUTSiCy7jGJtCGyXez/GuTwH2YYmlyW/JgAkGtswbgHL5Y1be7VktfWbRBpUa8MB6U9IDR4Joc0qtBdnkzX7JFXY7wlQFCI46EAbMZl+d8IcqmcPfwfVQhimWnRsh/m3Al96g0cr5NgtR1OIr8inYp/G3SHBlCsaofZ/hu/zrPu3P9emGFYzReD/tShRuL54hVm0I5F1N/yvb4l5z7fcMXunFjIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WYa3HjH45tLeZst82FHqztgFJXWtI4K9z4B5DEry0aI=; b=uPvZxUmK2AwOXpovXgvOIlKidoBj8bjvBYpPbnfg8GjqBb8d/dsFlDegw2Iviwxy0OeLRAt07FQru3NYkD6NsOlTuEsNgAE4b3QyNu+49qCbeOL2INOJHqiHdgDq+jfD7cUpjuYkipVq/ENbj0KmMr8+KM3JhlJgSTVGE+jdYRA= Received: from DS7PR05CA0009.namprd05.prod.outlook.com (2603:10b6:5:3b9::14) by MW4PR12MB6730.namprd12.prod.outlook.com (2603:10b6:303:1ec::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 09:22:40 +0000 Received: from CY4PEPF0000EDD2.namprd03.prod.outlook.com (2603:10b6:5:3b9:cafe::8c) by DS7PR05CA0009.outlook.office365.com (2603:10b6:5:3b9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.24 via Frontend Transport; Tue, 30 Apr 2024 09:22:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD2.mail.protection.outlook.com (10.167.241.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:40 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:36 -0500 From: Robert Richter To: "Rafael J. Wysocki" , Dave Hansen , Andy Lutomirski , "Peter Zijlstra" , Thomas Gleixner , "Ingo Molnar" , Borislav Petkov , CC: Dan Williams , Alison Schofield , , , , Robert Richter , "H. Peter Anvin" , Len Brown Subject: [PATCH v6 5/7] ACPI/NUMA: Return memblk modification state from numa_fill_memblks() Date: Tue, 30 Apr 2024 11:21:58 +0200 Message-ID: <20240430092200.2335887-6-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD2:EE_|MW4PR12MB6730:EE_ X-MS-Office365-Filtering-Correlation-Id: 36bc67a7-aac7-4165-e426-08dc68f7154e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|1800799015|82310400014|376005|36860700004; X-Microsoft-Antispam-Message-Info: vWgWzqOyaLPGjuAyBJ3r5gC6BH4Kc2lz9V5CL0W3c6pXVLgmz6NasH7bfl+UrHoJm3sNeDj/N2wT1caaZ/FNVj5Ldvvw1vKuKyjkUP/T6bltCMsrr8a0RD56BdLZCz0uPwvjrUc0LaeoWgxtivE1UlaE7G3DATqwfXZdBD1rR+HZrYgGVLnVo9GX7nVg0EL/eqiGnZ466jpuopOj2Cz5Mgc1aM6v63DBVLwfPRSu24Zg01EUbQX6inQ3miDA0AqnyN0WjuP1m3qJXLCy5RuqLeBpvbyHCg7Tid7UcXs7pkiRI9RbbeJPH1nKj/5uL9Y2KPMGFCBVYeL/ys7zjjMpWBabwCqdwSthP7hLze5LDDtNMS9gRgIGLUbZEZvCb+eI9/+sUpxR2WY4/rVthLJRFYZ8VzHJl7UUU/jHTA4V0WIvvwqJJxYEgiv62iisz28mUnpoWiepEHk+VLvGA/CKFgsVzSneiEL0Lg116T3S/E7mfR9vpIACYVZjD7hSblQMsC6A+lSG9FoI8oFRAvtea/AnCNfzaBU1OVorc3Tsqp5OK/o9oP+CD7g7d/U1+FmPt8nUljC/CnAMmwzXq02TQlKtVPsfHuISjy3UOlNe8RdIHKqMjF25fW1uPnPJ1yTbhmkGsUb5pzhlxojIah++fEoOHju5IqqdMBt2eXylp1OaboHmLypgXvaX0/BAuTpIONr2AVZeI2zFQg0+FxxxDbzgvc3IKKWLVz0eN19IY2kJEmQeLYK2ehOuIvC7FQeHATkihwCvEpJM8Tx0gByUiQrysfIEUborvrhSFYAGe46t99Z0gFc1pyLeTQ1F1RZJulxhP4iirHb3+wK4sVBIzKU5VpKeZEV8K3dlT/6L5eCkfdCrZjkzR6ql59lkh6TfGWEXEbY51FEYK1VTlIdtJJUnJKPUAcVkVjXmwAAJJsfzuO5L0sCfA2cucsWHmJ/jMFJmyQ24jOYmfowBw0/eRuHHJlIEV1IO7qECyXTZQZG8CtvMxM7pE2siKljTxEOUJPLMgaEnCtCsFfovuNoqd8Z0cfe8U6lmLiBXZSeXCEBQP+TOXWjL9KE5hWyxhZoVdD0gteIpD+usjHAGZnBjmcpcsQx7i8cXQARTD9oFpych/3dhuEQ8CQTsiBa4sKBPOIVHsEtyrwvAkkRUwIp0i6IUeBNJFs6M2nJ/3PGN5s1Ehe6SRJeni9lIAPZ8TXUjRuh6GML3haiLLxH/XuWS4Ki5v2P8vXGa9gfJ355drxVnv+PXC6KvZavWJFSP/4gNF+WYewEv1B10cU1K6Sg644uoP/oOn2LfksUnhPpoiuc4U499zq6BJIEInOT49S6B X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(7416005)(1800799015)(82310400014)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:40.2532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36bc67a7-aac7-4165-e426-08dc68f7154e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6730 When registering a memory range a possibly overlapping memory block will be extended instead of creating a new one. If both ranges exactly overlap, the blocks remain unchanged and are just reused. The information if a memblock was extended is useful for diagnostics. Change return code of numa_fill_memblks() to also report if memblocks have been modified. Link: https://lore.kernel.org/all/ZiqnbD0CB9WUL1zu@aschofie-mobl2/T/#u Cc: Alison Schofield Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield --- arch/x86/mm/numa.c | 33 ++++++++++++++++++--------------- drivers/acpi/numa/srat.c | 5 +++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index ce84ba86e69e..e34e96d57656 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -950,15 +950,16 @@ static struct numa_memblk *numa_memblk_list[NR_NODE_MEMBLKS] __initdata; * address range @start-@end * * RETURNS: - * 0 : Success - * NUMA_NO_MEMBLK : No memblks exist in address range @start-@end + * NUMA_NO_MEMBLK if no memblks exist in address range @start-@end, + * zero on success without blocks modified and non-zero positive + * values on success with blocks modified. */ int __init numa_fill_memblks(u64 start, u64 end) { struct numa_memblk **blk = &numa_memblk_list[0]; struct numa_meminfo *mi = &numa_meminfo; - int count = 0; + int count = 0, modified = 0; u64 prev_end; /* @@ -981,25 +982,27 @@ int __init numa_fill_memblks(u64 start, u64 end) /* Sort the list of pointers in memblk->start order */ sort(&blk[0], count, sizeof(blk[0]), cmp_memblk, NULL); - /* Make sure the first/last memblks include start/end */ - blk[0]->start = min(blk[0]->start, start); - blk[count - 1]->end = max(blk[count - 1]->end, end); - /* * Fill any gaps by tracking the previous memblks * end address and backfilling to it if needed. */ - prev_end = blk[0]->end; - for (int i = 1; i < count; i++) { + prev_end = start; + for (int i = 0; i < count; i++) { struct numa_memblk *curr = blk[i]; - if (prev_end >= curr->start) { - if (prev_end < curr->end) - prev_end = curr->end; - } else { + if (prev_end < curr->start) { curr->start = prev_end; - prev_end = curr->end; + modified = 1; } + + if (prev_end < curr->end) + prev_end = curr->end; } - return 0; + + if (blk[count - 1]->end < end) { + blk[count - 1]->end = end; + modified = 1; + } + + return modified; } diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index e3f26e71637a..76b39a6d3aef 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -326,7 +326,7 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, struct acpi_cedt_cfmws *cfmws; int *fake_pxm = arg; u64 start, end; - int node; + int node, modified; cfmws = (struct acpi_cedt_cfmws *)header; start = cfmws->base_hpa; @@ -338,7 +338,8 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, * found for any portion of the window to cover the entire * window. */ - if (!numa_fill_memblks(start, end)) + modified = numa_fill_memblks(start, end); + if (modified != NUMA_NO_MEMBLK) return 0; /* No SRAT description. Create a new node. */ From patchwork Tue Apr 30 09:21:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648618 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) (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 C2BA51BF6C7; Tue, 30 Apr 2024 09:22:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468968; cv=fail; b=ZD24WgB8yjD1rfYnLA6xnImKCGZ2U1FhNox7WGp5Zmsi4P+OCUNE/IN6A3Xh9hQ/cG5Uqn41vTEH5L54O9Xw3MHdTFv4+N/Dtzac963C/qsDEZKGjHc5gtH7r6TKCsjqkxIG7WoNRnbxoBASXxW5lw4hSePjOVD6ZaapWDP2rc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468968; c=relaxed/simple; bh=vYp95VMxzdzoj/DtrhF05Qgt5E0e6xXnhOR1Zpsoc+s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CTQ6RH0BpT38ld1u+7zxbHTSZcIExbcPod1O5aB+s2oGhMD5d/DHw0jxI+ZfbwnHTEbA5vJM6Y3CZ4yoF7Ed2dGUnP856X9E9VyPH4h7dLYLTMrLYyorDmcsZglEa8ef0nF3pVi37GzwzfzOrrID9qgWdSF4mf54JByhdY+Q8Q8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=0EsqwiEx; arc=fail smtp.client-ip=40.107.220.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="0EsqwiEx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RDdXSnuLwgVgT4Wp6NGuN7jDoVvaByLQ03q0JhOQ7STxMggv/g7PMM0CVhcXtsA3vNRa+sz/Bc5WFNyM6Ts+2hpA3CL6fX6hAObHrB6Yxeo3q1XTfCjySdKjzUM2AAAHxSdeXofmauyCXNJZDPeGiVFjzXZqDhLgVU/PH6Qf7zfzb5asW6MqqzgKXM8IehrXE/VNuOam1OC3WvCqgrfbSpS+fPRjUnCuv/k9ieflRPGig1Yg5tAs4UIHIMLU6jXTw46HQLaW5jXg4BZljkMoye48NYjYctIkf3ul71ZtY8kdIDwBVNiRltFLSlEq3Fwdd+bQrmGP56+UsrSQSwruqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZZxv3bUK3ryD91VcL4/Kx8BoqbMa03THTNbV5ekodRY=; b=mbmqqiTvm+Af8JTVQidNhkdxt3fNXkxbtlQj/i5y4ggG/43EBvIPVDrgk2/i0ICUdbGrIzTxK9xVEe3VVa8EJLNlmcIHaI666horRdgJN7VjFU8Dq7TYWajKsRgpbdmQ8+4TT0s8PawSqoeJex1cGjY9ZAfRm3iuWDPhS9G02PANsRZOD2ocXhKWKVSyP8tIAxzPjKg0okMr0cCKSASGB0we35pE0evZ8WJOalOe3UrZwqkjlnqRp/vul9XdLTBqEekR0wLuxFVPNX1iPLfKX0rOYFu0El5sqsZ+jBUgK00HQxCs3eTYjoF0qZbJKZpUmRzgxrEiCLKEm28bKlhGkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZZxv3bUK3ryD91VcL4/Kx8BoqbMa03THTNbV5ekodRY=; b=0EsqwiExj+jOQxGW1696Aa/beMAomVerIyRFwJzbshhuD3KNYkQXIYEGnwhdnqsd+fa6w+H7pVPXDgYt6KkB8zsedH+KQH0sP4blMle1+9nJIpBxZetd+1TG2T3FuIQWFZh6FBqURfrAyNHqv3RAtbNupKxY5t50TbyG826BeG4= Received: from PH8PR02CA0009.namprd02.prod.outlook.com (2603:10b6:510:2d0::22) by DM4PR12MB6615.namprd12.prod.outlook.com (2603:10b6:8:8d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 09:22:43 +0000 Received: from CY4PEPF0000EDD4.namprd03.prod.outlook.com (2603:10b6:510:2d0:cafe::4b) by PH8PR02CA0009.outlook.office365.com (2603:10b6:510:2d0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34 via Frontend Transport; Tue, 30 Apr 2024 09:22:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD4.mail.protection.outlook.com (10.167.241.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:43 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:40 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v6 6/7] ACPI/NUMA: Add log messages for memory ranges found in CEDT Date: Tue, 30 Apr 2024 11:21:59 +0200 Message-ID: <20240430092200.2335887-7-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD4:EE_|DM4PR12MB6615:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f7d2274-a3a8-4284-c926-08dc68f71727 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|82310400014|36860700004; X-Microsoft-Antispam-Message-Info: XOpRDEi6bTEaxkkOcO4G1GELz6LTox2v/h8HKDRh2lyT+Znh2+KbJWLOpwVrxHc+s+z1n15o7Z9+rIi8n5JYwN11F4oWvrtAk00OTzyfZDOuw81mKLvm/0Cnk9pjJsxmG/n3ZsFknm1MQAstfi2XUobljrZV8oR9mVejb3JPhijiWT/EOUOFnETsZAsUZIEOzjknwNsfu+WDcWo4ksfarfGOTGCnIAimNy4Qf3mZLCFofMOW83ZGCft89pZR9mwIlQ+XMq6fqKTEw8X3AgCh5JDfmv5GZHZ/jC7oC4tbB/H9Sb19fbjUXfmsq0tKgcQTbDhCEbflE4Wz7tSB7oB4INfconnaFm7Yl0/B+CU8Xzrokcpjcs8ULCoZLpBwPBhIDE9wn9tnu5qR1rNMzrbf/8Z0hCHci3eBSgV6kvco1fJ/xqtiBhnWCcWfnzwbN8okoH34VAQ5UrmmD7KKmDq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015)(376005)(82310400014)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:43.3368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f7d2274-a3a8-4284-c926-08dc68f71727 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6615 Adding a pr_info() when successfully adding a CFMWS memory range. Suggested-by: Alison Schofield Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield --- drivers/acpi/numa/srat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 76b39a6d3aef..34ecf2dc912f 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -339,8 +339,12 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, * window. */ modified = numa_fill_memblks(start, end); - if (modified != NUMA_NO_MEMBLK) + if (modified != NUMA_NO_MEMBLK) { + if (modified) + pr_info("CEDT: memblk extended [mem %#010Lx-%#010Lx]\n", + (unsigned long long) start, (unsigned long long) end - 1); return 0; + } /* No SRAT description. Create a new node. */ node = acpi_map_pxm_to_node(*fake_pxm); @@ -355,8 +359,13 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, pr_warn("ACPI NUMA: Failed to add memblk for CFMWS node %d [mem %#llx-%#llx]\n", node, start, end); } + node_set(node, numa_nodes_parsed); + pr_info("CEDT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n", + node, *fake_pxm, + (unsigned long long) start, (unsigned long long) end - 1); + /* Set the next available fake_pxm value */ (*fake_pxm)++; return 0; From patchwork Tue Apr 30 09:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13648619 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2071.outbound.protection.outlook.com [40.107.92.71]) (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 01CA41CB31A; Tue, 30 Apr 2024 09:22:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468973; cv=fail; b=FQfvLYv8nFY6i35ymtbfhB69/urv9b2f0H3tK5aH/7ATqxuCJhh3zitP7Jn2LycP4qoUCTUwqOSSQdk49iYh3GiwnLoSyiJps0AiqA8u24+8oShNnK6O/gIwdBrq3UDZqIavzd7J090xV9OyEuWZ0p6IKrrca/iD35Rz2dHdPJs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468973; c=relaxed/simple; bh=xu0ScFGHprQXGjeUjrlrMdsxsUwApZ59SWPq1CbOlj8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rzWLl1KgeYi/g8l5h4otbS2a5EDJX5XkgT4Oa6qkzXqHHhdwyu1lUO+dx6/Oio50C8uCS+NvA+Z1M2pGhY5PF8ipC7K8gEaQ9TMSwVxRB6ZvkUuk6e8ptb5sE42QSW2/Knkyq8sjFynxoivaRoJigZAX2canukxCqErDgUsik/o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=bavQ0b/r; arc=fail smtp.client-ip=40.107.92.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="bavQ0b/r" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKZUsnuvFjyoKzYTMx7HvEEKt7Kx16TqZY6QVgHCVtpJMcKL8QwOAD92vGYFaE3gelQ6o7FIXq9ZTsB4AYBsHTMdJZCqXr4bp2ricDmefIae0hBb81w60bO4DVQLWBpdKeyWJIWOCZvBGFTbcAH5WCM5Vs1k+J0VwledowQ6RdQJ2PvEYakZ1PQAOY+KQFNY9L90yr1N40DWBzymFdoM0wYo++PaQA6F33sRaybyPwY3pb/FKkm4IGlS1M63Mq82jtfPDBLNzRnNIpN1HLxm4kln+NnPdyw9boEflDU57/7SUIKTRHLhu5tj4Wcns9cB8yAWYBTX2SWuZ9xIJ+/l/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=auFNcIrPvH7HK9lxyY6YgTh7dndOSGd2/26TlLLxI9s=; b=Z2XaFPssE6NJ6nAHFCl/A7O2vCrHGcfBUtaAGBFMKlM2+13TyhjUPZJlWo8pZ63IHSHzOa5hAzq3tcnKwcblZVTOmM+qc1BRmgGmxfmKDtzAiRnwEd09sGT1hcpdKYf/NXfeTcRDN+HHSnc1qtwN7MHbHuktM6xOof3MOX7846N3qG3q+CTdt8X/UgDg+1YiSVyVU0nPpGHpHhYN+n9E4Ief/zmJVkVHbckS85ukrU9lKyLzePz3sRJ7YwshgvaTe8eLFwiy/G85AZCAQvR0tCQauJ2GykVKAbXLHmzcKfsw6rzGBNgckqmKaTfuUAxFTnIOntxvM+csy2MFVkpUkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=auFNcIrPvH7HK9lxyY6YgTh7dndOSGd2/26TlLLxI9s=; b=bavQ0b/rBMV5p0/2f5j9eZYKpWwWV/IWIs8P4TxzIJPaJVO8VoaxjDwmVzUOulxIOB7CTaTkRPyOWHsR/n/Jqx3BGOpBFBWpnjnDr189+pEYZCjzAXH6R+PmPcRpLUVCdNnM24iWWlYaWdme4CTORH8b8hgR+cqh7r1bYRfAr+s= Received: from PH0PR07CA0111.namprd07.prod.outlook.com (2603:10b6:510:4::26) by DM4PR12MB6616.namprd12.prod.outlook.com (2603:10b6:8:8e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 09:22:49 +0000 Received: from CY4PEPF0000EDD0.namprd03.prod.outlook.com (2603:10b6:510:4:cafe::e9) by PH0PR07CA0111.outlook.office365.com (2603:10b6:510:4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36 via Frontend Transport; Tue, 30 Apr 2024 09:22:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EDD0.mail.protection.outlook.com (10.167.241.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 09:22:47 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 04:22:43 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v6 7/7] ACPI/NUMA: Print CXL Early Discovery Table (CEDT) Date: Tue, 30 Apr 2024 11:22:00 +0200 Message-ID: <20240430092200.2335887-8-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430092200.2335887-1-rrichter@amd.com> References: <20240430092200.2335887-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD0:EE_|DM4PR12MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: 3bddaab9-30b2-475d-ec35-08dc68f71954 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|82310400014|36860700004; X-Microsoft-Antispam-Message-Info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osITNFqmN2dn0OSidvb9f7G2sW0ZnRztFgIjwvD9CiX6J5qv8d+8pZbHSGdjyabXxw3cOo7/oFGLFZqSNpBZcaODTGY1o1VR5U39E3JiDCMknscLnV61za1GUc3OkTCzkRG5ikYJDpP4g/CyVCYP9LJm8U7lm002o7hZTWrpRQSmSv9mjYt4qfjfjRFITuXt3yQacz6ArTTpm8vvqQdDI+74Yn44Elx9452saTztlfYCvpt2LyyQuAK8JHyePkJT4undm8TVCITKvhBJRh7nRWFmDaIiUkjk1rht7BXZJxNMhxQmbPF33V0fEUE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(1800799015)(376005)(82310400014)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 09:22:47.0037 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bddaab9-30b2-475d-ec35-08dc68f71954 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6616 The CEDT contains similar entries as the SRAT. For diagnostic reasons print the CEDT same style as the SRAT. Signed-off-by: Robert Richter Reviewed-by: Alison Schofield --- drivers/acpi/numa/srat.c | 111 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 34ecf2dc912f..fa21d4d5fccf 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -320,6 +320,114 @@ acpi_parse_memory_affinity(union acpi_subtable_headers *header, return 0; } +static int __init +__acpi_table_print_cedt_entry(union acpi_subtable_headers *__header, + void *arg, const unsigned long table_end) +{ + struct acpi_cedt_header *header = (struct acpi_cedt_header *)__header; + + switch (header->type) { + case ACPI_CEDT_TYPE_CHBS: + { + struct acpi_cedt_chbs *p = + (struct acpi_cedt_chbs *)header; + + if (header->length < sizeof(struct acpi_cedt_chbs)) { + pr_warn("CEDT: unsupported CHBS entry: size %d\n", + header->length); + break; + } + + pr_debug("CEDT: CHBS (0x%llx length 0x%llx uid %lu) %s (%d)\n", + (unsigned long long)p->base, + (unsigned long long)p->length, + (unsigned long)p->uid, + (p->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL11) ? + "cxl11" : + (p->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL20) ? + "cxl20" : + "unsupported version", + p->cxl_version); + } + break; + case ACPI_CEDT_TYPE_CFMWS: + { + struct acpi_cedt_cfmws *p = + (struct acpi_cedt_cfmws *)header; + int eiw_to_ways[] = {1, 2, 4, 8, 16, 3, 6, 12}; + int targets = -1; + + if (header->length < sizeof(struct acpi_cedt_cfmws)) { + pr_warn("CEDT: unsupported CFMWS entry: size %d\n", + header->length); + break; + } + + if (p->interleave_ways < ARRAY_SIZE(eiw_to_ways)) + targets = eiw_to_ways[p->interleave_ways]; + if (header->length < struct_size( + p, interleave_targets, targets)) + targets = -1; + + pr_debug("CEDT: CFMWS (0x%llx length 0x%llx) with %d target%s", + (unsigned long long)p->base_hpa, + (unsigned long long)p->window_size, + targets, targets > 1 ? "s" : ""); + for (int i = 0; i < targets; i++) + pr_cont("%s%lu", i ? ", " : " (", + (unsigned long)p->interleave_targets[i]); + pr_cont("%s%s%s%s%s%s\n", + targets > 0 ? ")" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE2) ? + " type2" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE3) ? + " type3" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_VOLATILE) ? + " volatile" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_PMEM) ? + " pmem" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_FIXED) ? + " fixed" : ""); + } + break; + case ACPI_CEDT_TYPE_CXIMS: + { + struct acpi_cedt_cxims *p = + (struct acpi_cedt_cxims *)header; + + if (header->length < sizeof(struct acpi_cedt_cxims)) { + pr_warn("CEDT: unsupported CXIMS entry: size %d\n", + header->length); + break; + } + + pr_debug("CEDT: CXIMS (hbig %u nr_xormaps %u)\n", + (unsigned int)p->hbig, + (unsigned int)p->nr_xormaps); + } + break; + default: + pr_warn("CEDT: Found unsupported entry (type = 0x%x)\n", + header->type); + break; + } + + return 0; +} + +static void __init acpi_table_print_cedt_entry(enum acpi_cedt_type id) +{ + acpi_table_parse_cedt(id, __acpi_table_print_cedt_entry, NULL); +} + +static void __init acpi_table_print_cedt(void) +{ + /* Print only implemented CEDT types */ + acpi_table_print_cedt_entry(ACPI_CEDT_TYPE_CHBS); + acpi_table_print_cedt_entry(ACPI_CEDT_TYPE_CFMWS); + acpi_table_print_cedt_entry(ACPI_CEDT_TYPE_CXIMS); +} + static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, void *arg, const unsigned long table_end) { @@ -518,6 +626,9 @@ int __init acpi_numa_init(void) /* SLIT: System Locality Information Table */ acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); + /* CEDT: CXL Early Discovery Table */ + acpi_table_print_cedt(); + /* * CXL Fixed Memory Window Structures (CFMWS) must be parsed * after the SRAT. Create NUMA Nodes for CXL memory ranges that