From patchwork Fri Apr 19 14:01: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: 13636436 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) (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 9012E130AFE; Fri, 19 Apr 2024 14:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535373; cv=fail; b=MxmNwXhDamwN2xOdGi//A8jOGB6PHAwT1o2zPXnD+0Xx27Au0Bt0VcH0EUXAR1Ej8XG5Ayhwnib8AuK0dXG1ixA5LuKXEpw0xQpEGdgSnunV53nWn806r/PKmzjvsIOn392wJ9uURV5BZV2I594VAaew4nSP06H00kAPs0vBDik= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535373; c=relaxed/simple; bh=0dGTOaXmCHT9NZpE/+vGsWAUidT0E2ucvppgSGZ9Rvg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DRykPrH/PV7qluFVIGUS8bu/V1uC7mLDDMhB/SdpuAby2tnn6ILjuvlAbEIiYa9SVnZ3CFwWMDRhSkuPE+evJTqdARcF8WJxmBi8/AvLs4hvAIOz778D6Ejy0rJfi8erhD+cqS6S9axEdy4XJlGllmatmYngMN1+714Wsw3k01g= 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=GA2sgwYv; arc=fail smtp.client-ip=40.107.220.89 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="GA2sgwYv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YyV0BdAVrftaaDnTtqf1mImTgKKiu4YUfNY6s/3f6IneTioBLaTOBxTLMyS0EpXvBlFIMmiT5DdsmZhQjlKsP4m/OeHUFFHNy23/+TXNj0mache0EotclqquEy57Q0wtBuI9FZsLfxToEFgHOQ1s+72HZMvTfjOInPCCeNkLmrSqbExztCMVPpPp46odeLkgOBYxVjVIfVytb+UUVACLqDP/24EgEl/LjfS2ij5u2tIovetjk9DCS+sVDKH3C10RO4bL93i0fCji87LqlP3Uaahkk++2xQZz/3TFpHYOIE4AkQsN3DbrQChuy6fMWM/JS40WvB1liwYr1iyyy+xCEg== 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=dcRR1ousZU1GbIQ/nb4zR0ItljQ/fF4EYkA4fz100MQ=; b=gYPSmtgqjNyvI/51LcHpGFI3OTwvqfuWn4jW24poo+eku826dIX5jzp4cl9QKYhN1bU2HCu7ICZpkUnpwxEkzSHuxlodtuVb9nlt2csjpsRPo3Ldh+euD3OYBAkiLFCVo/lXpXfoX54AW5UGBKF9B5FOYNr+nOQu+h3Bza+MQa/OHflpiMXhH1PO/nZo8D2XlIwZoLUrck9O8D1uEqzvKLDNvCk7xwlSRGlLhw1UN6d2aG4mslXrHxNAzW+rnM/atQoBAXJAqtZSCTPYNSpaNGyLn4IYgHsQjcGCL7IDaHccKg2OEEDhrKRRbfFZLVzUKd0axweZ1AJ4STG/JaUnhQ== 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=dcRR1ousZU1GbIQ/nb4zR0ItljQ/fF4EYkA4fz100MQ=; b=GA2sgwYv6RyePcmcWpN4LziCulVJPdNYukjBUD4lha1X1mO37sHkIf1Cc0yoBwhQk4roHg118eeTUBKkFBorEal58MeHZQn+KsZ87fqzyCxBC3YmlFFqj85sUrvEXIT5u1XpV6haJNSR8QlqSaB1aPKU93t9CWMqdcdAb38CFV4= Received: from CH5P221CA0021.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::8) by SN7PR12MB7346.namprd12.prod.outlook.com (2603:10b6:806:299::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 14:02:39 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:1f2:cafe::84) by CH5P221CA0021.outlook.office365.com (2603:10b6:610:1f2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.31 via Frontend Transport; Fri, 19 Apr 2024 14:02: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 CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 19 Apr 2024 14:02: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; Fri, 19 Apr 2024 09:02:24 -0500 From: Robert Richter To: "Rafael J. Wysocki" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , Andy Lutomirski , Peter Zijlstra , "Dan Williams" , Alison Schofield CC: , , , Robert Richter , Derick Marks , "H. Peter Anvin" Subject: [PATCH v3 1/5] x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() Date: Fri, 19 Apr 2024 16:01:59 +0200 Message-ID: <20240419140203.1996635-2-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240419140203.1996635-1-rrichter@amd.com> References: <20240419140203.1996635-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|SN7PR12MB7346:EE_ X-MS-Office365-Filtering-Correlation-Id: d3ffc03b-02a7-47bf-7dd3-08dc60795e2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: en9X1ENfRD2ydp/Bbv88VJhCvXYHF9fPOgtHi6lo41WjpgtWlA2wtv+jGhpb37bwbWYIx/civTatFfW3LE7yjIR0LtUANWTyjJcudIXq/1z/UiLE915ANUb2c3xTRWs2xaCXTrIlGmnZCE3Unl3HOwGcUQEZBahOiox8n8Qnc0rVHkgbt3XDFYBQfByVgfWN3NydWddBpWtSgc9OW5doGgHQCvDK2RdYXRuu/xyL6gAOyElowu0ey4Sg2n9Y3DAPU1s4FpOwp/BEgzXfNKpx+wTwnprk1ktUVVLe4JZ4eRTY9FZwZfj2gURAIfoEM2bczakLT7WD9Zp5jVsK9nsxCNm77B2j+he8s8iC4cMY+ReESu8JlKLB8np8DFMwTgld6uCpfHUgMFx7MaXsr+sJqiJ2ZYu4VpGYRQHZfXvw96FC9i1tpS/dH1LWFEwf+VfawvrxOGf5o+w48vwO2pnD1ElpqoYYN9XmOy9cu+k4I58pbwmDc6ntkqAkkn43YwcfaOOuCWi4hri+9FkfBI2ly5NjZdbG4OklniFicn1bY2tfK9yaTO0fuGxAKK5azpXjoyHny0kIiMbJFjePanerq0yxTsqPBAv5FgGUkebUjm0XF9NULzEqAeU/y2YOyIWxd3M+bAj4MidO7vxdm5VNvuhJd2pcmX7gvSPp9HTwK4aD9wbwzHKwkNLCmHSjFVzW0Pvt9ZBZLFJ32Zx+vuRlNzBwrk6KRKEzcC1+XpXcMeUSb3t1Lhu2Xn7DWkU6RBt3k+EaTi2D1UV8JDb4WYBC3A== 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)(82310400014)(1800799015)(36860700004)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 14:02:36.5996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3ffc03b-02a7-47bf-7dd3-08dc60795e2f 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: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7346 For configurations that have the kconfig option NUMA_KEEP_MEMINFO disabled, the SRAT lookup done with numa_fill_memblks() fails returning NUMA_NO_MEMBLK (-1). 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. numa_fill_memblks() is implemented and used in the init section only. The option NUMA_KEEP_MEMINFO is only for the case when NUMA data will be used outside of init. So fix the SRAT lookup by moving numa_fill_memblks() out of the NUMA_KEEP_MEMINFO block to make it always available in the init section. 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. [1] commit fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT") 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: Alison Schofield --- arch/x86/include/asm/sparsemem.h | 2 +- arch/x86/mm/numa.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/sparsemem.h b/arch/x86/include/asm/sparsemem.h index 1be13b2dfe8b..1aaa447ef24b 100644 --- a/arch/x86/include/asm/sparsemem.h +++ b/arch/x86/include/asm/sparsemem.h @@ -37,9 +37,9 @@ 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 +#endif extern int numa_fill_memblks(u64 start, u64 end); #define numa_fill_memblks numa_fill_memblks -#endif #endif /* __ASSEMBLY__ */ #endif /* _ASM_X86_SPARSEMEM_H */ 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 From patchwork Fri Apr 19 14:02: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: 13636433 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2058.outbound.protection.outlook.com [40.107.93.58]) (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 59C8F12DDA6; Fri, 19 Apr 2024 14:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535366; cv=fail; b=iJVWVnsu9rMh3zz0EdKNB29GU6p5ScnZBbUF3ugD6ItunASY+cr4UwU4Vum/cZx/B3WbMD2MmvT2L3WLOaZAYjV5cIejAbnqNrVB7Zw8Qhghm03GlE4xCqW0WGADYLwJiVQQe+8u1pkCMySmZiO9QDL+IITQ3TfpZEaauQAkyBs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535366; c=relaxed/simple; bh=vXs01KCJ1B6/8hJ3vlUcmAWaYvPucnQu2SRIM7looBs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pkgwxaa0ozoVsn9wfqQ35sqqlJF1NEzY6oGtx5e8vGFmcRSjXNvvvTPTpo65Y/TEmhgoO76y2zVtOfRjojp9nZR7kYMmOwFiSU8IS4pgVqui6/NUdY1HyhjXkAmQefourKi84POAdR5lSIoxTnYincxu5JPESyAy79mcdaNr/7Y= 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=V3719S/H; arc=fail smtp.client-ip=40.107.93.58 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="V3719S/H" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXCgyShTNYQOHgx1gjds4/kxB7pb8NFXsTi8AGZ4f4iacIrRKP3xDd8TOBRys+p0HKjirt0hgRZlXvMtCeqziKYv8US9eTdcu3D+m2G7ww2ZwMXiWJESE1+NHcuKJUKejAmqWSRyy72nCNUSNF2yaCsGGAL5b92Z8SnAC83NxuypGWl9HZyXmAobqmkeItWoYzrml/6Da5JBAkp5OQbma3PjaBBNV5Gz3bpqWjQqRUiyENFrp9wJtdlK7/btKcMaU18p8OXJmfC4LvuTibOvHJu6a6S7M7EQpzEPkbxd8f67/tj/336JuZQUXlrdwnTwie85pQXD6EaRSplR+/Apjw== 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=MeLM815AH6iinFumaNCPACcp54hhM4GYhHy8yiiwRfc=; b=FhNiqcFTLP0/mcB0r8Ge9zt42HNbkKoURs0tJ16r2DVxaY3pCxXl504lHPyPVqtFUf4DYIbbGqIQOxjGDmDHqPLJkYwNmcwkfvn6otrh1FN7VHBz8ECcNjgmluOqRh+4JDX2INzTTO+Ft5XtJdG0QHpGjkP67btGFs++UGxKghwoiWwrSNSLhGVS02/Ccunb/fDEGc9PXX6/z0r7130dzqxdS8BSIvmlf2NlgmopNKAIMRgo1r3eKel/cPhmZ+yxSW1Iy4EuRw5dsVy8EV5HOnToSzVuvHUQaNifWxZ4K/jlOOvlzNTytFM5YTzQrhlpE7IlaJxdlaednOGyPShuOg== 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=MeLM815AH6iinFumaNCPACcp54hhM4GYhHy8yiiwRfc=; b=V3719S/HeOWOBLLNlLoQ/7JVP2K/7o9GZMKpRF6BI9F1JJM5qSeKBCwVOdDqb3JbVhLYQ0iS+5648nETlqw9DwG66svY+i4gBAIn755CoEfsxJhNeKZI5sl5CTAXl7PMF1PKg+0+9Apq2SL88jkqCQpFgg+BXw57n/LBKzqZBHg= Received: from CH2PR14CA0004.namprd14.prod.outlook.com (2603:10b6:610:60::14) by PH7PR12MB6419.namprd12.prod.outlook.com (2603:10b6:510:1fd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.41; Fri, 19 Apr 2024 14:02:38 +0000 Received: from CH1PEPF0000A34B.namprd04.prod.outlook.com (2603:10b6:610:60:cafe::4c) by CH2PR14CA0004.outlook.office365.com (2603:10b6:610:60::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Fri, 19 Apr 2024 14:02:38 +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 CH1PEPF0000A34B.mail.protection.outlook.com (10.167.244.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 19 Apr 2024 14:02:37 +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; Fri, 19 Apr 2024 09:02:28 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v3 2/5] ACPI/NUMA: Print CXL Early Discovery Table (CEDT) Date: Fri, 19 Apr 2024 16:02:00 +0200 Message-ID: <20240419140203.1996635-3-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240419140203.1996635-1-rrichter@amd.com> References: <20240419140203.1996635-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34B:EE_|PH7PR12MB6419:EE_ X-MS-Office365-Filtering-Correlation-Id: 34ce1546-a370-4ef8-6697-08dc60795ef5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vIBjvWtH4VEwUdWWJ6/Cd2eMvAnOfcnFN62Ce96D7A1hcHYF9RXm5OkOAPpeN0zr0EOFm5ZaC42IeLfaZHcuwnZtVPBenMraN7uvL02hLcfhQZrJ2ErvAsJUcJ0deYYS075j+8fZFQQnLc2XpqZBFavdycqos6+sIlmqczuHcu2aA/kYXpgmsOHlKc5K1wWMhq2jIyvMPYuH07k5bokjO0+8Tgas8vup4a+jmH3NMuPgU3Agu1R+RRsgvt+fqCDRAhnJzdwZXMWV2AxGv/lyE+uG9QVw8krh7gMmcANqDUquUJ/1qyN/gKqzgeuJIoSvTh3cLogyOhjWVxPea2wItK2VXcUrklcbBTTvUZzxrlF4fbGnLb9dg21myhTPjPu2az0XBlzNymuYoHIH3NoqYjJcuSqaONT0TgQlI4ABJ/qv60bAtfX1AwgpfTaqpZL7pZooyDHDF0KoMDreErOnU8CsAP3s30pAkE6257lYJLfG72TOAE9S77bR9B8afO7VqVjNXpLEePiliG8EVRxSe8dwoyHG8/4IETR69JHd2KSZxbvVvl109bdqSIaCDbWa2z3oHvQ2IrFfn22asJKX4KuXQBJ0MaRyBAC2Jm9LHPePZBFVNRku/V+y2/2sZHZ0VxM+/pscwhceG4kW2hO9k7UVjOFkTu20lt94R0hsZ67xcf0e7WIzbsS6o1CsBuK7ahSmICkp+mCF7gh3sVRgtRcDIu6Iv/KanU5m0tmEVZz9dcJlInlykrTgBOi48fFh 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)(36860700004)(1800799015)(82310400014)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 14:02:37.8968 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34ce1546-a370-4ef8-6697-08dc60795ef5 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: CH1PEPF0000A34B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6419 The CEDT contains similar entries as the SRAT. For diagnostic reasons print the CEDT same style as the SRAT. Adding also a pr_info() when successfully adding a CFMWS memory range. Suggested-by: Alison Schofield # CEDT node info Signed-off-by: Robert Richter --- drivers/acpi/numa/srat.c | 122 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index e45e64993c50..43417b4920da 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -300,6 +300,114 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) return -EINVAL; } +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) { @@ -318,8 +426,11 @@ 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)) + if (!numa_fill_memblks(start, end)) { + 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); @@ -334,13 +445,19 @@ 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; } #else +static inline void acpi_table_print_cedt(void) {} static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, void *arg, const unsigned long table_end) { @@ -526,6 +643,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 From patchwork Fri Apr 19 14:02:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13636437 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2049.outbound.protection.outlook.com [40.107.243.49]) (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 41558130E5B; Fri, 19 Apr 2024 14:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535373; cv=fail; b=ZB5jvOOrYscNZTw7pJNmokIqdtcddHXiLDuIXfCp4Z2eSIWHYhtLsyJDdi5fT38gaDKQ19sNA1kdKxZm3VEscph0duntDpREJLLRUMC9m8eKBvmHRT1J1rm0nPTaOG8QiEKGWMYxQlWl4AGjXwYaKG/PdFvXJP2pB7wqsN2zhRg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535373; c=relaxed/simple; bh=nrg5p98izyopO9HGKONQg/HJ6PetVNP07gVz7ax+tPk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pYj4qMZK+FzfgBX05LNzZ4BFbFB9JiCCi/plJa+1Q4lo8YyWJAxyk9UGijlbXUiWWqYoEJJIgo05q+0EQvhXg3EA1DWyYUuUtVgnPytV/PbjCvvsKPxL3Efie533Ls5c/kcm4lShXKoVJd6+roOr+B/rp8+Q7c+kefYoMuaTvu8= 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=OW9plUay; arc=fail smtp.client-ip=40.107.243.49 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="OW9plUay" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CYpmoOO3ecaYMVJ9eJcBcCd9mo+xp6ur9J3t4vAte8Msb0IIfYGoOnxGsA9POMlZNIs+8AJhmmdTEdYGxyn4WUihf5v2H22Fq3eKHK0LjOTUHY5pDFKGbXPoVVGyWgFSdWfbyjicpmn3MnB1pVexmnrHAlEfzDItZh5a5PbwAg0pyvADijGqKbAAkgtfCiobtWnNfLP9Kd3osT/V1fhfFYb4axVEFvnpq6Sx5Sjfvbktf+xM7fzyUHbkOkjyPUCoEnL7D/EO9Vv1KloaRadxquStjusfN+wqWXdV/OcmujuIUB1U0JomNBJrPxpN4atBrifj+JK9+EOu6f0EHqIZEg== 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=gbcpqRHhqAWK8pl+5CSG/nVtZt2DDdnrbIyz9cLFvmI=; b=RpL8A0t957mm+1DHisnb2sAfDVUcwRMUck3wFqTXpWF7sEBQFAo/ROK6a1uCGNzYMruGtq5gjSQ1mu05GOaJiAIgkf8j9mEjJqlTJzd6ECFCCBK4nfxjZq/3A3b+dV9LZOw6451uigVR0hDgYatfo3SZZuq1jv//bczQ25rw1s7XrWFRKnkFpuzrueiZvWokR7lz0Rlszvk2t1t77fMD+B/356R8zA/iC0nVgBCVknPPH/n3NNASfl79hA0PhfHC3MIWjn3wOQbb1CU986a615sXKc2+lWboTW7fLLZnkRVhN3xX5z9oqhgBJKEHsZvdiS/bdOtjbBOYGjUHOw0avA== 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=gbcpqRHhqAWK8pl+5CSG/nVtZt2DDdnrbIyz9cLFvmI=; b=OW9plUayywGq28H2w93Cf5/cvM9SChYLnru7A0SD+eToWk/Pagyb4SDqZy7bj92+luhpyhGaPkuMaxKlKqv/ZkcqEGPjBXPzvkuEkxwIF9QOkWxHZ2eBALUAAxG8n42wPJV/muZor/Cz2QZ17PgK8wvdPODQZFjKWyDFYeBCN4c= Received: from CH5P221CA0020.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::11) by CH3PR12MB7524.namprd12.prod.outlook.com (2603:10b6:610:146::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 14:02:42 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:1f2:cafe::9a) by CH5P221CA0020.outlook.office365.com (2603:10b6:610:1f2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.31 via Frontend Transport; Fri, 19 Apr 2024 14:02:42 +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 CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 19 Apr 2024 14:02:42 +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; Fri, 19 Apr 2024 09:02:31 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v3 3/5] ACPI/NUMA: Remove architecture dependent remainings Date: Fri, 19 Apr 2024 16:02:01 +0200 Message-ID: <20240419140203.1996635-4-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240419140203.1996635-1-rrichter@amd.com> References: <20240419140203.1996635-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|CH3PR12MB7524:EE_ X-MS-Office365-Filtering-Correlation-Id: 058eea64-851f-4b61-0290-08dc60796185 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xGldNgZzmO7i5TH9XDIEdOhYh/scY+/SZ23LNRlHaqCCNIx/wOl+kitmPn6YJDnoULxa3GiuuPVJPl82oJg6Du8gDwbylGMRrAW0SF6X6Ti0ZOZn7LrrStmmrOhe65yLS6tROBIRmLcfR3avDQobvg9vOsxEASOqUObYxA28r6rEl953n/q3Aba0SLLqsFwcRClG6YHSAwmCHFWWWoCySjndIdc95ZLIrQgq8+43p9ms2VhLJDAzhq/W3SJaNUbW6wVyDsv8+2xRF4/Fi7SdAfnwJPF9bnVNS96yz01JpL2s9qUwff3mIpWLgNtrt95wNNnhHL15mC8h7VhrPDI8/AnJkR43H8Hp0yy6+gsmSkp4kPECDHqpmjKCXFIqsUP8tPjH1k36ygtEa2GQn4qVyO82hBv95zFN7AXfIR9cgP4Q/irHGVrLGXjv1Sd9CcyGu8Avl09MalFIb2h2kPeSbU1dYqmkdGqHWZxXeWYkvvGKzl3huQsx0gu4GVrIRjh8J+XRb77OmLmkDWHVS2RsML28vse0JPUXRFKDNeUu8IPNqYgDQ2VwZ/uXczD0qrLZNTJzucCgGUlMc53uxZDkRYwhimv/nINH2biEeH3WUvcoL69pRk7qCMzjNDvKKoNraHwgLjjb/7OBAztth15CxPEvkEceToRrjBxftQWwQGFqK71nl1tqhyOjTmAJs4jVxt9b9ozq4GNSk1bnNebiBPXfGeaLfRjv3BNlhVkaRqLzOdpt5/024B97FOV8oJoMl3rYL4STDJbznrXkz3FS14PLh2SA+tT3iHIsKjlwyCusTru32Hn1Co5d65+eAXWOdAS3m3c8ZZDb5XmFKAYpDTQK3F2yTrEcE5R7hFFBmiPdZOLiwQyUjPAPUhyd494kx8AUewCwT5qyB9fQMduZR5NWxhmpLn/YdyvxYjbbUWu3nINqvsEGAcCEom2HKmI2EaJURD+nCtp66cXm6ufuW6UVAYNe8ONK9b27Ox88yJW588xiFNyXmRfn3TzDvFbhR7XSSeMzG1ZU+xO2v4jeUPz/P/Q14OYGGM/EfPd08hqHoGZNi2JW2MfwsDJe+W/yJU/E1Q3Fqj3X+OqnCmI8VD93h9in6CP50J2TDOVgaSoQkIcYPo06RUZgVU4UehuC2V+M3pRWdgh00NyLT57BG9Otb+qmK6WRjcrjN+RQLVBaSpDtdGV9+K9U5hFRNfeG5/pn/etrWfMNEukjcFXt1oaqSflxD29hpVKciVujRHfJRg/z1myomVqHB4fe4HXz8WONJQiPK6W6qtMdlDFUiuQMYXl9Sop1gyPDpecjtMHkrVGEgSFZeB2R8NtUIkT14rhvTMuenz6I7pk85WVgs2ukqZQOnpCxfTlevO5M9UbLWSHy7i1E5ShJOJlMc6Hx 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)(82310400014)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 14:02:42.1621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 058eea64-851f-4b61-0290-08dc60796185 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: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7524 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 an make them static. [1] commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture") Signed-off-by: Robert Richter Reviewed-by: Dan Williams Reviewed-by: Dan Williams --- drivers/acpi/numa/srat.c | 17 ++--------------- include/linux/acpi.h | 5 ----- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 43417b4920da..bd0e2d342ba2 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -208,13 +208,12 @@ int __init srat_disabled(void) return acpi_numa < 0; } -#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; @@ -236,11 +235,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; @@ -456,14 +451,6 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, (*fake_pxm)++; return 0; } -#else -static inline void acpi_table_print_cedt(void) {} -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 Fri Apr 19 14:02:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13636435 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) (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 A6714130A5C; Fri, 19 Apr 2024 14:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535371; cv=fail; b=POhBJlI/KbcMP8Y1DL2ZIfItFI/lvhoQ6n3ewyEZs87EpGpL0Gq5dR+JB8U5sSPxgxt7wayUBSVwkmtqZ+5aGsEIFi42OUy4PJIOMhjObQsg8KwZ3nJpwIi6qfbTSIu6NRDQQqelZxRG+ByAc4xWPvSDWY/GgI2/1UpAGITC+s8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535371; c=relaxed/simple; bh=wWZn00pR0mxg6qbbKHXOXOaKz6XaO/nwjyLCtI3VJ3Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=st442Oyot+brbQ+Q4Km+EQVh+3r2UaJQLtSCKobem1GUIOqwWg2VAVeSGsGaMQFLyEDxTMYs7fS8cijOhGOAlYYpWFh1Hq/racJ69rW6Rm7crtBj+eDDY4AW5peAjVAHKGl9ZBFppPeJ2lJaFiimIooCh1DNxDxPob04pPfhENA= 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=v5MGr1TF; arc=fail smtp.client-ip=40.107.243.46 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="v5MGr1TF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LG7VvnIXnLE2gZhJYfceNpPB/PAbZkds1Y3aBbFXyGBWV3rs8rrotcbAjOVZqGDzjz/PpWLFJhJz/5zl8yjHiuVrq8yMhdXDEwTEJZFtausy/upbD6QLfmM6jLR9A/IOnB8+BcP4+YqkJSgQ8eAyf+9Lzf4gayLjjmabLvNrqAHCtTPdOOYR2xXUUM8Xi6xuaa8vugD/cjGWtcZ4Kz8QZn2LIs5xV286HHqKyPM4tA15YE3gvaGmf3colosfHl+HriG8hkN0RoXiOGnOKm+jLy8dODJBVC2v+0qZXVLeku9apbe0NMjnquFtkIWuBnhLB3WR2jR1ilQWmyCzkz7inQ== 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=2JjN48UjGIOz4zPwQx/47zapDuKMSrcSLyLKWmhaYWU=; b=j/YBweHhdGZkQL4qPGAsO7AUTpK8BzvmvEudpKJViqDLTqg+2M4Q9WOjinLqFqGNDMqGl9tU0qHxuHhj9V9+YvQh4Oh5o4yVKzrOTP69fl6IH3DlGAUYq3SneK1Ri5CA9TIe4tNQea+16xYnepXAUcKM3IFGVUFtjJ3yJCS51RkS10hFXujN82gnwDyogZEiRVSSG+H61bRTCYP+50WaLsEIg/W7CpAEpJHXUSU1hYgT1oE9BW15uRT0lzu+gVbILYQ0mUoQimnQJPLP7TVxKpJ5d4o+5glhkZ+FnUgxYO/oICBqeE9VRG2p9oI2+XKWXh2BwMqU/g937ywex4P9Sg== 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=2JjN48UjGIOz4zPwQx/47zapDuKMSrcSLyLKWmhaYWU=; b=v5MGr1TFwVZ4gCbwoo/M0N8jVQ3PWxl/R6at/CgvWJ8p/9y2U8GpvA8BRqziBBUxkufkI+mqz5CceBVHcjRI+EVnwZx2FJUirRQDHZuHhwoQKvGV0I9MxkNDGzRQFrGDFFc0Qpj4Dij57Q4RrUZd+iPAErQy+TMH/znIvdhm69w= Received: from CH5P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::15) by SJ0PR12MB6853.namprd12.prod.outlook.com (2603:10b6:a03:47b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 14:02:43 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:1f2:cafe::58) by CH5P221CA0007.outlook.office365.com (2603:10b6:610:1f2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.31 via Frontend Transport; Fri, 19 Apr 2024 14:02:42 +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 CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 19 Apr 2024 14:02:42 +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; Fri, 19 Apr 2024 09:02:34 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v3 4/5] ACPI/NUMA: Squash acpi_numa_slit_init() into acpi_parse_slit() Date: Fri, 19 Apr 2024 16:02:02 +0200 Message-ID: <20240419140203.1996635-5-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240419140203.1996635-1-rrichter@amd.com> References: <20240419140203.1996635-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|SJ0PR12MB6853:EE_ X-MS-Office365-Filtering-Correlation-Id: 7fc155c0-c834-42f7-395f-08dc607961dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vAip3yaWjd+VU0sZsnf6Ib1OSbuUU7KvsHeHU8cxsAQrG50sDqVXYQyQeNvtLmEyJu7UdStlh3pvGtE4d+GuR5OP+pYS0Y1pRct/Ys4ld8kbpcddyMJg4KphXYEFoW06bIWn4LfYfKaVi5GA8pjmp+bDnsP7un7/tFJjZXtBdJ53cRjwYZKLZ5XVbO2IH++ft4FjDJxBdpt1hw7lb1cfaH4yMeM8f7v8BrrmPMOTUG2uWFacAexYfV7PCpu3s9pezup2h4BchjzyzlWE/1eHkoOcYkkeDdvgcWVm34cyEkavMpgnQ2WLgpN8VHmcGKVnii/z9ArG/2MYNjE2ZZYX18SQs+JRalGnaBEKAeAsgVvjQoDG6bYS93YhNrBAvOliSacnhTerRUToF0n3Dh2VrQWoa10VhOSeTApQvlgdBg7UDWSrUZSu6QDEkHDDeDWLVLb/gzoiedaF6vCIqweTnm4VgwrdiyAfN/K5NIsOTeec/J8A5UNjNxG1cCNpPe0/jVuVt0y1LMl3pYkoXHKCTIJ7lX2EI0RtKTaxxOOP4K2LsPH6M3QGw9O9Y6x+oZgq/4sZ38UUGxTgNpTgEvwjHsyNUySMhUgUytJq474N2OaRBiZqKn+bzSy46JaAUQ7L/JAB4S2eXZ+Fsb4Od1yeaQ4ISATrcY4CwrxvEzwxLn0JCMd/XMLgWhdZBQGvzVUnld3v8c4GUjBa5LQ3oTrPyXup3XHXRgQV6kLMn+nlLgFnGhw0iKedSlbwwXHrwG5A 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)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 14:02:42.7715 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7fc155c0-c834-42f7-395f-08dc607961dd 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: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6853 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. Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams --- 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 bd0e2d342ba2..37a0f4b3d24a 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -213,10 +213,16 @@ int __init srat_disabled(void) * 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); @@ -233,6 +239,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 @@ -452,19 +460,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 Fri Apr 19 14:02:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13636434 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) (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 2530A12F38E; Fri, 19 Apr 2024 14:02:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535369; cv=fail; b=OMsD+8RlguGpOEjhFw3LBZ2LzijvrbqsGgyvL2kFoFL5K052tu2/C/W8F8zlDFJxC3w1TrEQtzhc922xTcbDwkh0IUGq3YEkqmEH3DGXPgrCBVKwWyOThDHpny1drH4GRkQAWs4hYsu/B9Mh14YLwVkSwnUBcyGpp/X+bh+ZVLE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713535369; c=relaxed/simple; bh=hQQFn7+NPpIkhRObYyxhCTgrPcbE5sLd0PBvzCHaMKk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hq2/EfkArtDCluX6o9hDMcP7YCCrP/1qKGjP4F0LO6BWblRdHJ5xrnMSk2hhJDKX+C6LmM1RIyDL9TCEOIg48HyTSQxfvSsvh318xdo1Pu2StsVJevxemveh+wI9qZEEg0jsmDqUjFgWZD2LIo9LPaO1+d30ismjzSZJWHIYkG0= 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=YFy0WgYR; arc=fail smtp.client-ip=40.107.244.78 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="YFy0WgYR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GSZGAf3i4YYdwBkHbl0GSz6ZC4hUigv+295NsBlSAXPBp8DEyisGPbZlxnESErf0I51Ni+nE6UDO9TFWHYsXJQSEIuF/UAWZDgib+9lUPM5r+5JHPaeIQ8zPlSTxgpZoqcxuvN7qwh0MAPxa6BLBQFCpxMjmPjenrPL6HVaitNdnW97w+hW0tua/nl1QdlsuzRjEn8HnjbT7paZEIAirihVgIuxHjQaFqHoRjJV7RmaCb9IPuTdS8EabpaYtmPvEB+fL+Y7rgFc90Qte094bsqformrivT3v4h18X18r8FhN1zSE5UYj53QAoKFp4vUTgL091JXZqoYl7SjksrgXbA== 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=Sp3I68tF4fFltDVLPj2CQJCoy2aIKVULYSXEujpi/xk=; b=aEbk/WxPCaaOrnHhBCsYK6B0Uizrso4XBCErclrnGBPcDxz39HEuWUkS9k5TZwpamQyZEWsW+Kr34ETcsTPumq5QSub4TJQkZAy9N1f1PDp5Ov7uHK7ola453ZkGsXJbDWACiM0XrZ3FicfL9BVcYbOUUsVUFe2H1w90sfgovwf+hYKDi677Cb2vruG7aWtSTA+LtAUkrIxf8ClBLDzukFTmaobwrGM/xc2P1euWBtHKwvftm9oyFkUwGN6W+H+oyZCmWCVfrT1+DVOpCJYBGP+v8YJ4wJ07s/9wldsEsxN33v+YVY2gUdK/Yaii1eNsPLsgYzHAADHNpaJdDsYdlQ== 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=Sp3I68tF4fFltDVLPj2CQJCoy2aIKVULYSXEujpi/xk=; b=YFy0WgYRoN4q2DTNTBdu4k5795WyNNfC4FtCBOu1OQna3l4u2Y7bZxvpJfYoYHp1VOPV3yfLvksWvPORLdfs0rS0v/Es6/4/RgHpNqoN3RAdjP1gIDKQ/QT+2ax5yuCLLS1OHuAHJ8Oa+BGJZs1nMAfQG1Z8JUa3BDnfS/tcBo4= Received: from CH5P221CA0012.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::16) by DM4PR12MB5963.namprd12.prod.outlook.com (2603:10b6:8:6a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.37; Fri, 19 Apr 2024 14:02:44 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:1f2:cafe::37) by CH5P221CA0012.outlook.office365.com (2603:10b6:610:1f2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.31 via Frontend Transport; Fri, 19 Apr 2024 14:02:44 +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 CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 19 Apr 2024 14:02:44 +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; Fri, 19 Apr 2024 09:02:37 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , "kernel test robot" , Len Brown Subject: [PATCH v3 5/5] ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity() Date: Fri, 19 Apr 2024 16:02:03 +0200 Message-ID: <20240419140203.1996635-6-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240419140203.1996635-1-rrichter@amd.com> References: <20240419140203.1996635-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|DM4PR12MB5963:EE_ X-MS-Office365-Filtering-Correlation-Id: cf9b0543-1c1b-442d-2dea-08dc607962d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X/9DjHW6FJicihtEH3RK23Rr9m1K3XCo6Q+D3nHc+BR78j8pTy6dRPsA6gEsGirJWLkfzdw3VB7oPaxzb3tmVXboNr9hsvCcH7WDWCWWJ/EjdYek1YyUwvm1PGiFjkaMvBtXlR5qtXwBSG3+ifmzeJT+fzNvykXjZR+XlJxi5owWdp+8SYMQzJAx3ckNz75pdyGboUrbOuqwy4+LW5SWL7FUotBsxGBuu6yduNFPCf6t7ZGiA7PGmNY4cJ7wfUij0kWwyHCv8a2kxUo6GuAdv1nRJ4zMG1rHUnfpWkHbd1Lr1dNSGy9NRwHPwYGZYA/n3LhFjzifCp40ojVUkKgHSEe53AXmr8Xt5ooSm4CjfXaE4I1mO2lY/h32p3riU3ge/BfcN/HFsGwc0JJD418o9j1xfjxeOIbCxYCMGJ+YSOinOGUHUNpilde/ntp84lcti4Hx7wkhp51+F0K7YgwsMytNMwXqEzdHuBLWybRDQJ/Q4Xf9tSbeRMrcA3DmDrkMStTVoloUaYiAXSH5iryFSzNogcPSXdHKSUsvQZA8FfhamihRmHpiNiPTNxhbQ9Xoy+a7wr7ZTH3wgK0klIZAE0wYcTwO0/mE4we5g6X5Kr84weALK9sYFc8RCAUcggKHNcPtK7yQLoPBItQHElVjU6YnUt+Tj+Q6twOrqP5E7J6db57+nfkh095m3pep+uUtSQWamu6dIIgjO1J2t8fEa+kyo3nap5Tiz7nxtcWMmYPe6AAYF8IcSBv6kCF7vSYX 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)(82310400014)(36860700004)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 14:02:44.3965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf9b0543-1c1b-442d-2dea-08dc607962d5 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: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5963 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 Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams --- 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 37a0f4b3d24a..cfa1cbe4a1f5 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -243,22 +243,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); @@ -296,11 +304,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 @@ -549,24 +561,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;