From patchwork Thu May 2 13:10:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13651710 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2057.outbound.protection.outlook.com [40.107.94.57]) (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 D4EF484A4C; Thu, 2 May 2024 13:10:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655442; cv=fail; b=Ch/g2rxdMK2WECamzdqOW7ex+9JxZXLqWS/WwDhT+61m38BJcxwXKf3y6E0Aa+A0c9sUKKZZeYS9LzpwJm7G/6CTna8NWgPdNQMcIqkqwWf6sUwnWH3yAHF4ZZVIIYsDYa/6fq1cwBXjxkxbVzSVDYZl4AecDReerYABDyvi8Io= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655442; c=relaxed/simple; bh=w9bhUqg6oqAtYJnC+gvdjbA2FR9qwJ8cIsGDaNiKjE0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UdfZS6dZ5TJbUwUxKUNEOQyBHsOe3ggJj1y3G8WwkZFhdJzOeuL5TdROeEUcr/y7MKmK69mpzJjv/6vEFnOwJrQ15ey6MYXPIfQCMquJ2hfDnJDByVnzy2Lto8ecaoPDxad1n45a/5K3FIIwEIw4EJbx0AAETVRSqV/4VQfVXDo= 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=OR96MOx9; arc=fail smtp.client-ip=40.107.94.57 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="OR96MOx9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1dm1noD3ulkcxJdQCCRz0y9ykGL6kkyz19al/mydF79+QpRKit4tBC5TB4KWvaE8uuRjKIgJfo54Fj+K+6Q84RTOHH5nykStjrPLsRJaTcpkjqBP5W6bUWoAzSdLIA+UF4yYqRcsF7F306vzMk1CvC1RK09vXhtPjJgbfi9Xe2ebGHIrQf2bPPNhhpBP8S0JpIsVLzW15neQZmgk6wafbSvW3LWrXBs6maLKzRX6c1MhHIjpLxLZHARlNLn9kc8XiWrG8lj+kOlnjq5EP5q7WXLYE+xRRJNrTZA0+oX9eaINTGJOcHzJqqHFjyyjx/BRJdFdiranF/4Qp2p9n4yVg== 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=H0fBmZ+MpiN8madmmxMpxrrfw202+Ko/QzP2gtvv7ZA=; b=Qm+tVVIarLFoV24tIXAS2Nw95G1qDMB5uBsXe2JHxERbjYizB91doTEANpMeaHTzu2pxjwgcVrmBecD6y00/H7UAm1T1aUNnFuYKsSfy43i7iEIPKknSn7ocDNb0KqhNetUN41dA42xDfZqmZLxEzDEEi6JKIJi0oDMCsu3QZy6ItlLyhP30B0pVdmNaMuspWbY1uPNjXiJvcAqBrMAHDBQCFK0g8nXhRGL00QWEdzcc31CCd4c5Mg9bO1bBbh8E5U8zwfHdRq+xsRHJp+vwyqXM9G6QSlNG+6xKdx01zkkU2x513tx9a2smpBbYfx2seYnJeQLrCVLFICSkrDyMUw== 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=H0fBmZ+MpiN8madmmxMpxrrfw202+Ko/QzP2gtvv7ZA=; b=OR96MOx9tcBcbql6jaSBCUelkJjzUFyGUUa3iolA2SHMNTPjMQGjA2R8Q7tYKPZ6WKwZtz2Djbh0yosY+wlYEyLVwur0td40CaJp4V47/BHa4jihr8ATsZYHLk+rGvTAGZl34F2NgP2/xkikdy+biQvF73UIkgYJCNHcsJbr+wo= Received: from CH5P221CA0014.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::7) by CH3PR12MB9077.namprd12.prod.outlook.com (2603:10b6:610:1a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36; Thu, 2 May 2024 13:10:37 +0000 Received: from CH2PEPF0000009B.namprd02.prod.outlook.com (2603:10b6:610:1f2:cafe::a9) by CH5P221CA0014.outlook.office365.com (2603:10b6:610:1f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30 via Frontend Transport; Thu, 2 May 2024 13:10:37 +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 CH2PEPF0000009B.mail.protection.outlook.com (10.167.244.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Thu, 2 May 2024 13:10: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; Thu, 2 May 2024 08:10:33 -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 , Jonathan Cameron , "H. Peter Anvin" , Len Brown Subject: [PATCH v7 1/4] x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() Date: Thu, 2 May 2024 15:10:09 +0200 Message-ID: <20240502131012.2385725-2-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240502131012.2385725-1-rrichter@amd.com> References: <20240502131012.2385725-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: CH2PEPF0000009B:EE_|CH3PR12MB9077:EE_ X-MS-Office365-Filtering-Correlation-Id: a087797f-9cb1-40dd-207d-08dc6aa94214 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|1800799015|7416005|921011; X-Microsoft-Antispam-Message-Info: j3uveNV40hoaS3+KBIYWHp5776UTqdoyLmbmDDwIJaG6ib9VpS7AOYMVDaIWyuhRepUWv+Ke7BdZo8wbPFp5F4n9O9fRAfVAnszaSNoKOKGzXkZ7y8+n0eriUl4pw1ps4etK2Ct+iqdOFT96xieAJ79/ZNw0occvScav9jA3dgDez6/WCHQuVGXDKU8ZhB5sxIVJhSgHLh7qi1GN6LSwULBJj2STjc/WF3jlGiak/5TdKauSnPeASMej38Wlt4Llj8w+vhizOOvgu2vXV10q7iCXH/Qk1vp3x4lRAFAVJBSAbiiBopVk6ioRi+ou9XfiS4Pw4xsImfHolWAPSW7jZrp0hkEbZLQVh5HLYGfU96sZX/xcWyzmyCCbewdVRAcux9CAgIHLodOKcUsyYX4k9/tdagza0DbkdPKNQVdaBgUGTiVyYasxLLwnNEZw7MOvJU2wHXmo4ZiF53RlluNu5sKlJB70JESVrLhB8JilPPqfiSdAA+TRLjujZM7Oig0NNmcmohzNAYgLh153gy7R7rFdkY5w6iWmYX71VKQaTae4el35E1e06FyepMEYA+wiu7oHjeHytxs4wae0Be3zYJP5/rsefpr1pQ3J9pYdiqaH2SIigTpAr/+1QlxY7JUl7Po+XdCyz8eUiG/IEkSQq5WHjQ4D4JcvuYau6XSRQNje5J8HDDqFGS9AFmnqlTNnvmrG+qQJXMiuADGqlLs4zoT/wC6JWB6UnTr4dukMvhRpdQUdcCJ9NsuDSfY24uP+y9wmLrRJsGDmMYGiWhN1i6rsQ7ysubS2cQNt/E3z7IRX27IYMkNuzBPCxEyuW+SQsdTzVjB7C/WcC6jKJZISv1gazYpmFAKeCtQW8JFHuv8NHqzGfMX6t/BYNf+Z7NinUWKXwXm7gKSuU8LzsARTx6uon+Mk0w26PbSiOfSarTDrtZRkEZePMWuOjuEXqx+tGq52gJzlcJqzAmrWAhjTeRam3Ic3WWWFUHk6Sf2YZZ3IrxE1vqymVXJv8wNTP+wZDJy5AlY+wgKrhdfH3qDHMQikIqhbUeO3z+0hWs33u9Wt+YzI1GIBZDkLx5yamneURymfoG1JpQvoL5WkMYTnogMDIdVDT4FCqr1OiTl1i8VjKakNRE3czWvxVTdzUG5wPp6+6ij0TN3GmVkQ3uFJaaOJk3E6V77pjfFLXrRV42ust5/QOMRGoVQosKBFZX4sRo0EYt8Bexy28SeSiYHL671jAiLJH4T9xVm+iOnoA9yInruS8vjgohYO6e7l/xhu5sI3kFNgTf7oQz4mVb3oqOeadKi7egEa0a+4YBnhKfHBv8rtx1nOh5Lh4NDlSIuJuUkGRW71fAaZiXPH2flgZg== 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)(376005)(1800799015)(7416005)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 13:10:36.9775 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a087797f-9cb1-40dd-207d-08dc6aa94214 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: CH2PEPF0000009B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9077 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. As Dan suggested, the fix is implemented to remove numa_fill_memblks() from sparsemem.h and alos using __weak for the function. 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 Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Reviewed-by: Dan Williams Signed-off-by: Robert Richter Acked-by: Borislav Petkov (AMD) --- 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 Thu May 2 13:10:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13651716 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2071.outbound.protection.outlook.com [40.107.95.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 193B184DE8; Thu, 2 May 2024 13:10:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655461; cv=fail; b=itMArb7Eca2xUWBSLV3avl10EAx/aZF4iur6UrbFRfL7RG/xJ5SY4vVB+tn8Q0md4gkJoyuHVY97hl7QUTyxaYNDO8zY6oNTqYk4kZLXF/yJwFrGlet1qJrqLQ0Yl6L4g/w55Sd7/NlDYOBsczQlKq7sCrxTUsV2guRLnlPRzQs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655461; c=relaxed/simple; bh=iXR8lCBOw2pJcxMMYwjFI6zH6Ru+QQkAbcZ6VaO+tl0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nLhW5ydHIU2DUzueaILAE4OuxNU/Sm2fZbw8bKLnIoh/DNOVEifVTfGFqgOgilEnnNgHGQuckx7wF8dk3BEX49Y04A1VJeDoxId+wkC0ZZdojenjVXuNQ17c1pNAYzZOxN31epDbYML7rPQhA5dAYksIGGJBaxOts7YdzHap/UA= 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=xperB7mq; arc=fail smtp.client-ip=40.107.95.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="xperB7mq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ngx46zBKZRrubqALD1OLwOz9SQ45cvROOojLbwbVfIvMxQ519fJzAF/2rxqicycRBb84iudzBU7EWKE0cHXqQqcLh5HSGqnIKO+APVGIjnAgXZCinhgNBg3UwWSR8z3lJeb09K9rj/q8H43anSMwh5HDVi/2HXd0c300m4PrjyCR08jh1Zv7J0GYOWlNaAkNYuvk9nOqKvWrY+bvhyZ5gaBW/WTdLRkRJUPHRR1uCoFp/UXNqLB5UmiIaHm1w3qufAuOZ2+PcUrkE2aORoc4Z9I+A/1HrX9zyMuaqpiI7f2Z94GkYHUOULVio8ueYq7OwhGAe4KJmT0/92fslyroGQ== 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=yzYUJuAYKm1do27SYeL+f93Xc9Dgs4ObFK3fmIQdZgA=; b=nZBpHZFlcew5tR+7IaQpENtJf/tu9FCHUbsPiwRNT2q46/UKDNICZJAEQTwFtnV2Mm6yL3V7Q/guitWHnbJdV7xeIgUKgKf9lnw/iW7AHbnAkM7OY0X9IDhdnHgO0DF9tf8hrhw4iABdAL8ZCtWG5CeLxaS6dILgfrhiQgqiRsugcDcS9UYPRazFP+d0X1AHzyATltRCjSUNWChUuY0ItLOgFIDfF3i0FOYhw6B082bXG1ddMxysnebifI41QE/ZLz6kQ+UtbZsAZ8bWe8bvH5nSjBXDgzRPiZeY3nAYgTd6ubUI5rqC4e0VbGEHMxsr1GM2GeKrK9eTu9R2UMVOLw== 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=yzYUJuAYKm1do27SYeL+f93Xc9Dgs4ObFK3fmIQdZgA=; b=xperB7mqxzQFj9cQpS7ElWfVWLgD0f7KjYnn/9/9yG0iVQ90sLGKZ6V/OVskwH2cRu0jSVNeTFFOe5/Te9P6K3/gEVPdATNdgPKxrgQn0h2uDNvUHckXwGH/99NRq9f5ejf9CuY1kgzk3axQ+N0QRM/nOTpsHH9R/qPAhJQxXHA= Received: from CH2PR05CA0023.namprd05.prod.outlook.com (2603:10b6:610::36) by SN7PR12MB7979.namprd12.prod.outlook.com (2603:10b6:806:32a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29; Thu, 2 May 2024 13:10:41 +0000 Received: from CH2PEPF0000009E.namprd02.prod.outlook.com (2603:10b6:610:0:cafe::ed) by CH2PR05CA0023.outlook.office365.com (2603:10b6:610::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29 via Frontend Transport; Thu, 2 May 2024 13:10: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 CH2PEPF0000009E.mail.protection.outlook.com (10.167.244.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Thu, 2 May 2024 13:10: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; Thu, 2 May 2024 08:10:37 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , "Jonathan Cameron" , Len Brown Subject: [PATCH v7 2/4] ACPI/NUMA: Remove architecture dependent remainings Date: Thu, 2 May 2024 15:10:10 +0200 Message-ID: <20240502131012.2385725-3-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240502131012.2385725-1-rrichter@amd.com> References: <20240502131012.2385725-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: CH2PEPF0000009E:EE_|SN7PR12MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: afc424f4-509e-4822-c9d5-08dc6aa9441f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|1800799015|376005; X-Microsoft-Antispam-Message-Info: ISWHm1iZ1NT8GGsggDcSIs5DQSE+gZvijXWGXkx364wX2L9NvrPY6Xry41StgmfXLiKGWdRZtbEoaE8ePBQprd8ixzI0vfJkb6/pPBb/mRDvcPxyDK8PkV/SFWeQiEgu/IsY6YwNx5mKmHuwuEHLjZ2pVKe5ZuBHNhDombQA8PtY3W66IptVhu5zbBvdLp3gsrUL8pqYZ+Vo6Xb8V1EaYz2XltKtz5GQ0VdtfPnAkKVYNBS24MveFUcyDbXu4LTTRjbST9kfX4/xmosaa1gq6lgGo/PNoR4MoEBUaQ3n1Z7Pj2byETzZcSbGyq+S1n+MEon0WpJZVjfAPclmxFOGHb3qonjvB/VyqUIEUHyCKPdbp+IPY9MDU2lfLn10FqABlgXcZCnfKeXh7buNdw8uYAH3mjvSiWCkIT3zyNxQj6EehTc/RgmL+PNyiBJeWjKRdacwX72b4p1Wosp3m9bxh2EAvEuqVlQi+LMja29J4BywKL30ReW0FEusu/yDDausSGafIVOXKx1TFWHDbpVPhErFiCT0MpSwcTCWYKpSKsr6dGmQ6R0AiW2Bp+YLsaalIUEokWdUkfOJwUfem+35UWlLCkgAlJEZPtIzgaUhG0ne/QzY/vTWwNfrUMHV/CA3bBxqBtU6OXKtmifxlBLfgMj3ra1lhOnTROugpzFTBGEk7yxDOgAsPookBtmhyhD5QcjeV5gAF6yRkd1awYNhcSmPEDZUouohQseRtV6KP8e9MFOb/hAjgT1qR5rQyOmC0DIxLublV6iK9W0k+xjzKfAjTI0tssyyJru0nRnfZ/QXSesKxJIpp4ih4JAxA3071t9/mDuNc+pSUUIjVJbroqTYhhERDUAONSNpO6bBmCZysazG6p02sKU8FM7U5ZiKhmQW7SA4cSZ3D/B1taQjUJlKRU3I8PhFaHFghr0nd2pyt+oSVCYDrRYl1QP7C3s53/bo3PamEOuQTFZa/fLI5ChCbKA6s6sooq3qVXWfKGPzxFHfEYOwVU60m48qTk+XzQY4eWq+TwkMqxMvDl6QSRUFEt61xH6xvnr64hNSR2wTDwkRNogUZuEOOio6rQMy9rPyN0XJFy8b7i7ZfgJYiZj75NcDn69LmEThAru0ml7Sv6eBHkBrJUnEwf2pACmk11/5201pITyUDom/kHZnhzt++cwF1FwTkXCvs+yfW1++Ob+uBEij4alxT5/i88l9/SxKYqRBD+Apx/f6ghs/XpUcVlnhxiawGwaAuHSIeZPS/usjPJLG3xgnXpqah8R4/TND23O48P1ExBAYEBfTmASM/YHotmKdjqQKeu4QvpN9bKwiU22K5vRjho15eHuZwz3/obyWpgRORlSOCW4Fkiq/+SYVFbL53sLe1Imx3bUSjSeQ5fzO7u/IelLRVlJl 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)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 13:10:40.4094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: afc424f4-509e-4822-c9d5-08dc6aa9441f 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: CH2PEPF0000009E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7979 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 Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Signed-off-by: Robert Richter --- 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 Thu May 2 13:10:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13651712 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2042.outbound.protection.outlook.com [40.107.92.42]) (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 EDBE383CD1; Thu, 2 May 2024 13:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655452; cv=fail; b=Kyih854gP5nuBFyNZi0WqZBQjq6ujPGW/y20phgVvpFjPgdfylDBwqHfsHkJX8q3rMBUwkUQ9n1TI5Q19l1gdlZz6vK8gUAJFB+AMDiImaRNE951n5AI26N1XdOxL0u0Qa7GKDHIbhjMri4/b/hXVtXuAVAMwfy7MdqLdnYAQMg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655452; c=relaxed/simple; bh=v1JhYc6iUtZ9TCumyvSWziE9cjMb5FtLilah2sWZPB0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FZuR+qCkiB9qjDOIE9N6CcEylATUYgVa53xEpZGinnyitB/jAoSsKbkeYk3VSKiPfPWlRPXiUTG8gB1VbdS3vXvGskNMhbVNe8BHtPKn8Av3TK2w6wXsIVgyxm4STZxRKNBr7fZwQVCj8WihIZSP9mPGDZo5J5VkZfbGLQEIKjk= 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=ubcH7Hpr; arc=fail smtp.client-ip=40.107.92.42 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="ubcH7Hpr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZx0aJtdn8l4C/T4jtUy+3c+cyqxzXNcyW6M2wcw4qF8AEsbo14wZvFGjRWKJ55CL2Y0IWhJXL/l6cH9sj5Vb0nFEICafXVQk9YhvlUN++v69F/5mf9FRge2+UMvNRiRP/qF45fccZ1MERr9ZYOGSYA6AUVYXpK08BzNUAVWg+0UTuCuCf5HEV8HIMUOQB6hy+CjPgbGGN0G0NY6aRlv8/rIlOiwunmS93OGBUlZFXWLr/KWwX1Mf3Rgm9CNmwP9lgwyTCFb7bgRr76sDj/vx3e/F2AMnf/Wyk5Evcl+BojVwaoIsG+Nm4xN9JEb0p1DnO/3KzVDGO5DfFH+QSLm+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=64z5yhRlLAyXKvUjNmlOhdqIx2ToTLjxrNdfM+KGR8M=; b=ap1dG68GMGnJMBtO203cnfeu80030bbDpUaP/eHnRjXunpTfMNX/KyICOOBIde8jWVU3i2ZopMGICNa4BWaV2j9fyOroEH3XCT0Y0w3p2APSFNV1z3aAcR0BGPaF5X6zyQ+9QGLTn4C5enn+Mfg3g2hCnRRO5FDA4/ToFUwfa5zG3NbOF437Nif4GK3H2SAHPNshi5C+yNBnBjBVCzIzIhsW6KuQPhqh9E0qn/KX2FltR2Q+/iuBnDulavaU5hrYhGXeOgXCbNFtYyZLKR8DHloeR4kBiMAelKxx69190aWg9zl+p62EXatjKVEO8taluBQe5a6ra2JdM1rNaqFQxw== 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=64z5yhRlLAyXKvUjNmlOhdqIx2ToTLjxrNdfM+KGR8M=; b=ubcH7HprUvd+TJmiHLxAUWK40+c8/2hIxj0kDXcoVwes7ghEmO6H5ZHfrRyVMD9+qwOOutf1JEaCAsk5KedfxMg9hsAoIyIuLrW2HPtNBpycmhTP3SXx6ss3heGBFiGaGpAXVehX+kR3VoLZzaNlgTFq88M6trBxR0m7MPxZCWk= Received: from CH2PR05CA0004.namprd05.prod.outlook.com (2603:10b6:610::17) by SN7PR12MB7369.namprd12.prod.outlook.com (2603:10b6:806:298::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Thu, 2 May 2024 13:10:46 +0000 Received: from CH2PEPF0000009E.namprd02.prod.outlook.com (2603:10b6:610:0:cafe::6) by CH2PR05CA0004.outlook.office365.com (2603:10b6:610::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29 via Frontend Transport; Thu, 2 May 2024 13:10:46 +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 CH2PEPF0000009E.mail.protection.outlook.com (10.167.244.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Thu, 2 May 2024 13:10:46 +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; Thu, 2 May 2024 08:10:41 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , "Jonathan Cameron" , Len Brown Subject: [PATCH v7 3/4] ACPI/NUMA: Squash acpi_numa_slit_init() into acpi_parse_slit() Date: Thu, 2 May 2024 15:10:11 +0200 Message-ID: <20240502131012.2385725-4-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240502131012.2385725-1-rrichter@amd.com> References: <20240502131012.2385725-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: CH2PEPF0000009E:EE_|SN7PR12MB7369:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e002282-0414-4a75-02db-08dc6aa947a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: 95jXfq+nJPv3ZA0S1HGoyV1Y4igwipCrwL/eu2blQjaXhDBlHVzqzFBsBDgkJOd04w6iJfpZL7NYp5sGSKcZTvQsMvDcf/zng9LLditWg9NWs5tIcfR/C2UwjpXIhSUC7VRwNx+S2raNYswkwL6GvEmhj6zKbzkIbwt/XxBN3BsEj1Lql7X3rByLGHtn7/JllQ6FjzW4CaOnXJ+SV1T9t7FBlPPl7UO0VvvvKRcVK66wZCAaBdVWf84jxe1ILAiuZYHiRYBXCf7xapxoPWrRBjsw5u5DYmj2gUdVg2HkHD6l913KPEGECwbkBln6cYLbjuh3QPUyU8nzO9u8WRl3dAL+fKAFMYR23l+Jf9Pb163LvxptM+FX7fGf0CJiEOcl9f1md9yJCAkKThMluAsa74yZWPnEFPnZmrjFXBa3AIXL9tzmDmz7Fc4zEFWliCkJpiHjjZG5bmM22oMWx1Cl6G6tj5i4Zl5pHKVPF6N5B4SxMgGcC97HoLPC2z+8um746uPpHHS7kqSUWBz2ILm8aB2QHTHwCPvX87GvDxfkBH19rDivMgbaf5RrVUsoEKRrQzZXVDuuB1zm0X0De98F9TZcfTl5v/A5VuUMGfounJH77/VG/Ot05XA2TdQD8xl7oqNrJZ8hjGro0dq8bmoSJoTsQWBVPsy/gz5xDkIt9aBX7k11PhOWky/yOZ9wfMWIwH8w/5rZyfPZiJrzAi+r/9AyqRzkxP6E3ykT0urSKMc/dFMvSDyUsb4180Pc0lIgIHBEi5232dxbq3wl3g+WCJ6vM3jkTzk1vi/4TOeGZFOK8tJKuT1jS/TWBzSL4+RK6rjnSYo+K8qB1OdU7bBcI+NZm/pHDDC7uAlsUWIrQ4rUMPCMOZae50tk7nW5pQ4zXFVhjC9bHuOh6+3ZKb6AGb+03cfhM1w73H/ik17o+L4TLl53GDgz58aSTKFCEZqXTA58Ha2UOdgthLcNVkzwJeRAFtx2ktajVrDyONYAECmef+kIqNa06TkENapVpSF/nYoyKBV7FdntpIVDmUJhLmFMPw0wmeB/D0iiEdvOFu2wWfxfpoHPSq8peE/b8ZXlAaLQqQSDoR4hSSeJEW9hpdtXGDp3isP0/dd92qvFNz0jscoHaITMnjdetjpE+kXbIQqET9FSgV4ddnOo8B+0+Z5Zxzf6y9nbv3KokEn7QqxYwirXSZsCnGaeXiyr6adj90vKeTWAOsmk6p0n8HO99wyCKlOUN9DHY7jqIMAQBmGNe/gue3ZWLxfHzE+eOYfwrLHnYQibdqZkRogCL+zCA+1F7DFWyHj0tGiDicy0KQHu8kfZWMDKKMHnSeAZan5+YNna3posVuYIWK+705uXGxiPvt8WzxgWYAuESIXF3jk= 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)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 13:10:46.2219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e002282-0414-4a75-02db-08dc6aa947a5 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: CH2PEPF0000009E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7369 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 Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Signed-off-by: Robert Richter --- 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 Thu May 2 13:10:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 13651711 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2085.outbound.protection.outlook.com [40.107.236.85]) (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 F28B983CD7; Thu, 2 May 2024 13:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655452; cv=fail; b=Ih/nBN9Sd95zyYecWpEu79x3ALd9YXnBEtsycb/FCNvh1pgmBmVdN/WseAYWvYxD8IxHJGt9k9ebt1J3OlxEooKX2CbT1CrDtrcz+wLcR1IXt9d7E1LG42ZLLe0egMNwpGhTaEt2T36dFuA7+8N+Sfyjj/FQnfhipgtcfvI5Ahc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714655452; c=relaxed/simple; bh=HeKeVI6KpygkIb8BFBFE+pakQXHevgTfaW1U1phxRZU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ebiC3Mo7OzXT+7lxMlK6kyO5w7UNVmkj5Iu7b3YQAnJjhJvu64cBCh0b8y36gT+hs0NetEs8J5DwK0sRBxR8pl3iqMkXb6b6UL5bm2kj5PesibKOfepmch725fTJKFveIoICaE1vXGo5YEHIcZvPPYq0gcbbBhSdYH/SwIPLZiM= 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=YYNPtAB6; arc=fail smtp.client-ip=40.107.236.85 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="YYNPtAB6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hP/diH3W/LDgV2umxGzDsQCLhMHppxFzbkXke9VlmpvpvL3Y7DONfdEzQ2DkymwZv5PrbLT5pBSkImIiOpGJ2AZ70EG3nfSKBONfdTmba5ovwrpqN0WZftNk6PQxH9npFZSeyNngaGV9vc1OMA+18QPEGHYcX3GoFEy9wQ61yCE1yF2iws+HTAoozvWnY4KKTqzS4i4MJdzHlmn1+54ffPMvBllbCDkLTiI/298G+sSfj6V54f2fR3LNXhQgEUFecRbjVEJpRIVe2vNehfLpcasA6OvQaZqW/2MqyeLQTJ/9BrYvOSX9MuckaAwHArnCphxD3QzW2H/BCUN5HdgLMA== 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=79LEzeQ+aNXmEq7qPbfwWsE0OxP0u8FWNga/WfXvwpg=; b=RVZxeuqx+PcfLDsgMV6A5GE7ZveLYgFQUSObcCvp3yPWNQUQXgOki6HYDzM8KeIi+7b4k0wmCDcjxT/EGjxfYpvo97O1oBxEqZJHL7pWxYg6j2C7DiJ3D6vD9FPcMCjQNOu1OJqarJJknarw3o2NTt4AyDQRGPXqTv91tQjav2mVyIQyPjvbxrXFWIxw5TZe505SwPty4AjLlhOHtHbluKLEdbnRbDMMvqxk0ZyNNKEJgjO84zi4mF3qeU4Q0f7BEgWQds7ekBbUZQHTnBthq9zjxDe9e60eRg6ZPBaPfULL7qGEjr9/fHvG8kPxUclA+7j5sTpm9liV/ehtKnTgug== 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=79LEzeQ+aNXmEq7qPbfwWsE0OxP0u8FWNga/WfXvwpg=; b=YYNPtAB6GhSFF40ZFrp9F0a2kXxEAKSKyUhqm6a9lYRVqclD+tVFJJuqRl83uYVdzaMuVpsHgbFdDc9Qe4NQS+HetZ156f9Qy6GK3dAUm3Acc8QmdhW9XmkZ7INF3UTQE2WzJsNqZ+GRJjwZWGrHMEKNv/EnzbuhyZCShNMZRVw= Received: from CH2PR05CA0004.namprd05.prod.outlook.com (2603:10b6:610::17) by LV2PR12MB5919.namprd12.prod.outlook.com (2603:10b6:408:173::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Thu, 2 May 2024 13:10:47 +0000 Received: from CH2PEPF0000009E.namprd02.prod.outlook.com (2603:10b6:610:0:cafe::d4) by CH2PR05CA0004.outlook.office365.com (2603:10b6:610::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29 via Frontend Transport; Thu, 2 May 2024 13:10:46 +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 CH2PEPF0000009E.mail.protection.outlook.com (10.167.244.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Thu, 2 May 2024 13:10:46 +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; Thu, 2 May 2024 08:10:44 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , "kernel test robot" , Jonathan Cameron , Len Brown Subject: [PATCH v7 4/4] ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity() Date: Thu, 2 May 2024 15:10:12 +0200 Message-ID: <20240502131012.2385725-5-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240502131012.2385725-1-rrichter@amd.com> References: <20240502131012.2385725-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: CH2PEPF0000009E:EE_|LV2PR12MB5919:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bbd913b-954a-43bc-9c55-08dc6aa947ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|36860700004|376005|7416005; X-Microsoft-Antispam-Message-Info: 6iVJr7Z50oNixksMslMzAQXGvnFuTg0gOW8Ybr27eM3US2hcjJR/MpM5q0mvl7kaOt8z5bbLVBd1BKBCLj3tr4RWnkakXCEHrTHSMSPkB79xLzepqg/Pe2LeDaTCtxQKC/02abthEDWnx2Ok8Enx7ZwoLJ7B/N0LuigL8QAOxayAdQbjV1SaDGBGyuFaDASgSrOn1de+SaMB9dPDqzBq98PqfCxWqw8GBWkUVUM2gNiGxJjNAtKjd6nGyVcl8msYNsrIy9eLZXVuoKVNWot+XivPXVLcAfgZ9F4f1Cl1Rq5LRyIlv0+ijhhTcZpc82+cR+mODWYBZu+0qYlHgHSx90MrXGJ1XUYT5UtZ9URKCy+SEc5UvPd4jNYdO+YHOLyj47pZAS07qxKTXeMjtYyOvgarRg2DiDv/RKlwCqkqu7CXfyUPLlBCmrN8rGuyeYH7FR07DoVbEwSWlWoieb7zWUQfc2m5lyQoYGb6YJLA0R7kI5HUy2Kqrv8G4o3p8jNtOLqZYIihSKgVzdR7NvaneBS++VwwotCv7VKkyao6Km1MFGsoO3DPjtq7Z5vItXlLQUsb2HlnJ7EaLwa8F55KDIOxEWok3n9PWXBubbq28J2boDf/rWLyw6jy8p/YHP+A19MFbmQkeBYHGTMSKvRYWD7a4BnM7fpylWomc2gCadPVpgN4AO4HNQiawHfmQUUwrBBiiWa/gV3yE7haFBP/hhg4gF0F2YE6PVXCtCgyceM0TaHzpuEXl6fI7By8/cHf7CmLtPrWLQNhx1UkytOkZfoF/JQYlOPEQlgvGTXBZk9tobF3r5dZQlVimdEizCyRbG8fj9CwcGK8cnYwv4EbjKVCT8pok1It6NdEua0fMbgGUG6m/GVjYpNInND9PWZq/i1fh0YP8rq31n/m0FigjQC6u3n3yC/HS1DEcHXnr8qlk6emKa/YjLxGsKbKGPZAp4CSRz3sKhrc6bG+0e/313fc/b28vzxVpbJBVUvDUF8wW1Ner+oM/Qb4OD7VUlb1xRn6CeGga/pLacg88+lHV94U8gSobWVcvHq7FmHkiX3ZbjXKw6Agl3hYCIy0KuTJStswz3CZpar8VrPgbu3Z6e1FcarbI/OSaghzaz8l6AvqqsKX22Is+jQGum/MOq3SRyaxIMS47Ha2X7gG8HFk70PaHcKbRJffwFDp4V5WPca6Gus5O7otTSZSwm42tbCld6tMt6Pmor6YZKhROTL64nN7VAzZjpX2cOHRp9gSls5mqEoi66z9efebfrdnKdwWu9e85Ap1upEg0bIcvqjxfOTmhCfYLUdPJox4QhxhRHr9+snBGxFJ6u8FB6NOZ11j 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)(36860700004)(376005)(7416005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 13:10:46.9094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bbd913b-954a-43bc-9c55-08dc6aa947ff 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: CH2PEPF0000009E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5919 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 Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Signed-off-by: Robert Richter --- 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;