From patchwork Mon Apr 29 12:49:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 793417 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2053.outbound.protection.outlook.com [40.107.220.53]) (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 C31B36D1CE; Mon, 29 Apr 2024 12:50:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395031; cv=fail; b=mQ0TOA4jQJVFMOUbVjr6Okwekq8R75naNuBaOvYDg76qADUFoq6MSw2UieWt5rIg3mcs0LtUW9mx+VU2rCR3uZuopEdPBCIQLNg/TgZjHU2mt+eQpCfSRZZwzXarJcO4VtsZZ57f0N1ukMscVznCe0+qQd7gTnHPtJfRblAAZ3s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395031; c=relaxed/simple; bh=647u1z3wRbEbaOeS0NL+K0zW6YDbrE4mrsl+FRUBytA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EtJ2lSv+MudSSu4wi8SA2jK5dLh0pbEUgR3DYXKNDkvZSMu2VatooAreU9TUWvezZZ3mQBEGP2hmRzupP2kUUeno/jKtICX2UMiM01Vvtc69zqa3NV9tDvJOgJuxLmEjM6qQbw2vHH4dtNuBo9GKjhvpLCKpVRRVto/I+W0ov24= 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=rNhix4IG; arc=fail smtp.client-ip=40.107.220.53 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="rNhix4IG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lTRjyAM7GahJKe6HY669c2Yvd0OjrIvk8ZnD+BXta4jeERaZE1u0Vhb1y5BkdHurzAS1yLw7pV1/hyf0EZPQQV2xgaxU6GvTVSbO3bCQRhe9B7vDCbdFwkoW9y7oczL5H3WpA/keKLimCmrsmPOA//L91NRaepxi/Ly2e0rt2JdJfKZH1171gstBqamoc8+Nkz+IpvzaEIzyywimoZ1aFT7Ng9WlUA305DBx0WCp9//QjpqwsZLhjdlWqpJq5B71Y1dcfYZzXNQEGscqTD3bUXZEzbnntVjMsv2aSRLCEdmp9aFgW28uueTdk1CcYv1gaupJzODOPXQc7OUd9v4H+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Rbiu9B8dMh2GCmUdkxKoTB+BVLOyjvHNhJoJbm+eYlg=; b=niW9aluuRDgXg/9tBkMES3VXIKqefiCWc4+9vax4r99WdatY9QP24m1DsDwYQBp1oHcMVWvFZeHA50Xsxp8ub6rJYhSs/VIXZmiCs4C8HWPOriKKpIGyouvJv+Njsbx6d4YwK5i0oXoaByFYqB+36SdaPx63rLQpGI/Q7L/0zxJ1cQ0Tc4fntKu6xhIELEH8oR+GGTq3nY2Ms6VmuvZj0i6qFvn7vZAa8a9+bXSWZUakqzHVJ3SFycT/uBoReMSADG8CN3sD8+wlcR5pXIj2Vbb8yuzVdbdDU4OHHwLcXWcNsOubbaxryaljcnSRHTN65z4qkRm8WsDdCoNNTMzyVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rbiu9B8dMh2GCmUdkxKoTB+BVLOyjvHNhJoJbm+eYlg=; b=rNhix4IGyydneQIAH52USFvZdlPBArHBXe/h0RKoE7FS2OVoeJ93E1FbHGgHJzJySlnhrR/O0nxbIdB5iuIeREwmqe5Ijp3WLaQpbxUe0vgKSVFFgNOfh02Ux/JhMCZzUvLfsQ1e1XlwRefrU0S67NZWU+pYJlM3jnVVL/Auq9g= Received: from MN2PR14CA0028.namprd14.prod.outlook.com (2603:10b6:208:23e::33) by CY5PR12MB6525.namprd12.prod.outlook.com (2603:10b6:930:32::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.32; Mon, 29 Apr 2024 12:50:27 +0000 Received: from BN3PEPF0000B371.namprd21.prod.outlook.com (2603:10b6:208:23e:cafe::67) by MN2PR14CA0028.outlook.office365.com (2603:10b6:208:23e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34 via Frontend Transport; Mon, 29 Apr 2024 12:50:27 +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 BN3PEPF0000B371.mail.protection.outlook.com (10.167.243.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Mon, 29 Apr 2024 12:50:27 +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; Mon, 29 Apr 2024 07:50:25 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v5 2/7] ACPI/NUMA: Remove architecture dependent remainings Date: Mon, 29 Apr 2024 14:49:50 +0200 Message-ID: <20240429124955.2294014-3-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429124955.2294014-1-rrichter@amd.com> References: <20240429124955.2294014-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@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: BN3PEPF0000B371:EE_|CY5PR12MB6525:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ed3f78c-19ed-4606-0f9a-08dc684af1df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|82310400014|376005|36860700004; X-Microsoft-Antispam-Message-Info: 338ZUXAVv3Og1nFCk4cu48A/vRe/x4RgBsT9saZ90atVSJwRJe8RAlTubu0tWQNssDmcW3IrgHOa7qaH5AIGf8qXKELqriE2BqCpv8+j2aqP5tSnRYQ9CLxgGVYOrGrYeKlmaVYm4qKgJ+0x3EjNjpi8R/4066oFfWR0fg3h1GOKDjpTbyYpLBogya7jBIg/Ln9wIws9dx4GwvJUgjcTLM8CcEimzFzZUYRq6NYWGEpaB95GaR7vGy0MtXp9N48o8//fF3hHpOgnc2vBcQTuKMvlEkMFM8mjBtGhyUcAw3KcAL3+J9kBgtaiQbJUC/vAmBkS0T9xOCkzeDwOikSezPWmYtuLD6mWhyYDX18ZweSehx76/kmpCCXBrqGIhUbx4ef1xMh1NFcpPSW/RuJzSFB60SOVP6iAiPe995/aKIcbHxcFdo8bDOIQqVovTGZ4ZjSf5kALyMxLyebW9pq4pbFqIZAloTlI9jHDmy6Nv35PDlgfFLLRAuwfNxe3mCydZ6skD1YytaG5002N4vmGDFPuaGjsSmkTBIiQChJWobtHimVH5FHvr+mMi06F5YDQyP4pbkFk2cmFG1ORQP0+S3jS3ZiAby59T2/XaK+AaUBw7i56lJ6rQs3UAW5wKVNt1NEh5r3ys1dMTXaXwYNnRsTXrE2I8Ab4y7rlZlZOHwEr7E3mS+GgxbqYKkDCyhiV/TrWw33wJJ36J2uen76KKV9JnhKtTX7azKrVCYZ8iHX9rn/q5phgX0Dx3KUzgq7elYKhUQkS6VlI0dAMjrQssqAQa40cqyc64N/boGmxjqDDfpNK3JIpag+Qj+1arZ3uC9B72N5GZ7uWxKkGjOd9ydiaWNbubcj6AjjpHHzM+dd0+f3MtNWfcmkdeICj0Q1SsB+jDhYru4COpAf1xtIRxc8vPIYTO1KdM+0eetkcAbX9S1ghMtLCaFvfczWUD7GuUSSdM5bS7Ik/HJw8jXAobwAxJ7N/vJ8vXN+s0IDPPOvqNna7FiM+jym+vUrnolXLoKSJ3yr5S9S/UgvkO7vUzEJ7w7Ij6vIGAiCLcRh688JRDf+3RYTL3ctki8h/Il+pVLll2BwgJsJwOAtU77CfCMUZuP2AJL9W6jt/BELSVBWkgKMqrFwlNbFzf8BFPT6/d1T15hn5YfG5xuonl8YV59I2pCmUGEp/FcaOnGX6ZwUmn4BV63COYmLdI2//+uyDzUjulGZul0YK8IxLNZtJ111/qpWrDMT3nQoEtIdFqKi5sxIGPpk2Lc4XwfwFiq813ClV4D2DXWuDfOxkYkuDqUIE4eHvE7yW78f18vZjMzoqlS9ivCsp/oGxv+buOFDWzKZWF+sTx5093O+Nux+TCd/cJqZ4IiSu/dKAqOuw7nU6gSCD6BKmvAHoEMx8N4mO X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(82310400014)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 12:50:27.4095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ed3f78c-19ed-4606-0f9a-08dc684af1df 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: BN3PEPF0000B371.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6525 With the removal of the Itanium architecture [1] the last architecture dependent functions: acpi_numa_slit_init(), acpi_numa_memory_affinity_init() were removed. Remove its remainings in the header files too and make them static. [1] commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture") Reviewed-by: Dan Williams Signed-off-by: Robert Richter --- 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 Mon Apr 29 12:49:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 793046 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2063.outbound.protection.outlook.com [40.107.244.63]) (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 C7BE27317F; Mon, 29 Apr 2024 12:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395036; cv=fail; b=PsZRlF+eAjuSMKWcs9kEVeHdvkpdlSv8wj0ZcL1hCQ24GxcN1PAEwbXb/izSx/2xYYVvpFWrsw29lVQbeZ20PAS0e3nIdY56LPbXS6RAeyNs8rEeia+qZhrb1hOSqK+QU5LpnkmBRrnCU+QJMdV3WI5lFHRzor5Ef1zGBqw2+8s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395036; c=relaxed/simple; bh=3A0QL/Q2ZLGYAxVW0jdhOQ0VW3DumNN9kZB9MQttzwQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tuf8YlwoBEmwwJDsHKWEwZ1SqS3AkTw49Y0hPYvOHaHkwOST61oIdUpeEdQON2Rji1Cbe2sovxmhaJvgSnCHFVpvBtjAlEicJgpfhfXnTZAvvtiLGEZl8qvOO8/VyWrd9gdTDgnmE8n//v8C+YgjNsNbIyrgh3qJI2e/yx0D4Us= 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=uulUhtrm; arc=fail smtp.client-ip=40.107.244.63 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="uulUhtrm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X5YFAQkmN73aDAfDr6EmWuR1Kt5ceWYHHSC2w+4D3Oj+77Qe5aG4+HHG9yhqOMB8BZkzgITadXCxdRnCWSeFuWwWDKAufsIrOfYqrAMWpAz/+Nfa2ug3QITU6vvJvnzmLu9uS9AZoxwygMKISKslf7XOSqtnvNW5cJalZ6OeDrRqNgNGw1EEIZM/SkPYzwk/WX/KMsxEvUnVGw0X1mX7YOKkAsV20uRIF41L5gjR/8nUk9nv7FxwaSHchTJistuPRcwR9eA/FZcteAUzdYdixWBtrO4yaf2bXldtDe49d5SS1kWWpYnb62RFUJQcuWqAh58nNTQsk86XxPefe76uRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6UISV2JCdeG71+wO8w7lSn249sa+w/Qr4NBQ9V5O2Ko=; b=NLFKoAGhsKMsTLrOTmcFTvyHp0qIiACu0LAyFZWTLQyAXmHYBMK9CuQcEeYJvx85HAfgu/apUMQOSNHMWEhz7T1VgDte0UX9wRWjcFvE4Cs5Gi8WbXz+riqWoe0oJ/oPwx8LzPzsVj1a8gYmopqcq4MiRtU0zf5w/0QIlx9y6GcTOpFOA2nqrI8AKnhE9QAIzF9T8RZ4w0yvOyZ9eCwbBHr9zMKo6iQ6EUcDtqvJ2aKNZw940eEjpcqmtleHieYQMJvUjDNqm0Y8NQV/0kTaiuGTAa6wDlre/1n8VRlKJ2RiiUhuP7NAjYFRNQU/flzIcB1lJVJlvsDTfvyFfwxJpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6UISV2JCdeG71+wO8w7lSn249sa+w/Qr4NBQ9V5O2Ko=; b=uulUhtrmUY/9V8IOJJva9s+Z3WYU7Lp508O9RR7TyPBMvW865x48LAcgwKTzruPjxSmhc3w25SmxKFr+HFtoDz8tcNajpXSF2jbEwJq9GA5mWHo0bRp69U/2WROKw/C9RxCmYDXqXM59oFAvf5M3GwU9nIzqHrYevGxZXSxo2Wk= Received: from MN2PR08CA0022.namprd08.prod.outlook.com (2603:10b6:208:239::27) by SJ0PR12MB5635.namprd12.prod.outlook.com (2603:10b6:a03:42a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Mon, 29 Apr 2024 12:50:31 +0000 Received: from BN3PEPF0000B370.namprd21.prod.outlook.com (2603:10b6:208:239:cafe::9a) by MN2PR08CA0022.outlook.office365.com (2603:10b6:208:239::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34 via Frontend Transport; Mon, 29 Apr 2024 12:50:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B370.mail.protection.outlook.com (10.167.243.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Mon, 29 Apr 2024 12:50:30 +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; Mon, 29 Apr 2024 07:50:28 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v5 3/7] ACPI/NUMA: Squash acpi_numa_slit_init() into acpi_parse_slit() Date: Mon, 29 Apr 2024 14:49:51 +0200 Message-ID: <20240429124955.2294014-4-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429124955.2294014-1-rrichter@amd.com> References: <20240429124955.2294014-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@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: BN3PEPF0000B370:EE_|SJ0PR12MB5635:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bcdb0a4-c498-4e62-518c-08dc684af3c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|82310400014|376005|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: xCtUv+JrWYoZ97/hQgyHKn8A5yRw39ocf/ERROUQN7ki6pOX7U8T6GbVnFexHltdzBxJboxdjfqdx7/8zDEUL6QXYod5MIm0w9AtQpJ1ZI9fXDkoPN6QtmTFhw/DkAqlZcasny+YOevloJs3ELVVgOWf5KVyF6ehLK1s+wZpHmIRPAgiyVi2KX9nAyD1ppQaOjfcQuiJ0eQ4vOk4aLGIPKRfexaYion/TGX8VTq/AsBGZ0DebEQPe+hGr4Zyby0upxU1y92s0j9WBPvwsb4Hqvxp7qQ6poKFubCczVYI48Z31TGSZcbqxw1FcS+gji5AkMfvndoLihzlJyYLDXsTieXHo0dcMH6oLYDveHG1ZG5DVAyeS4tsNc66yi2axf0C8C0nZB4EsUsK6MiDKIfxuK5FWinemh4TYUMOqklU4BWuU+MZlb1cL7xUqneTvu4Wsk0arvM+YUpoQXXsEGcvcnJnMbBMsvXX3ZVbCkALp4shd8ncRxrcnd7Mp5p1rtFpCtKqWhCPPxPyy3Zq8pL6AGqVFteEQlnoYtTiZwf3G58+rodTvCaSdYPe72l04+f5Ze8BHiYHf38ym/47PW2WLA+Fzv8E8v2d5eIwr0hvH2xkzA1cVYB9Ej8yNmRPwf4bZzH7TRPF4KTeVPDu3I25Pwg1s0m1w3O83M8ytbtVkDEizauJ/Tt4dcvP3tIGU6q9acFpkV0ysLVCczVZdceKVB/WO91/AU/FH/376Rm4RWiUsCq5X5AifI79NP93XlLaGqE24c2G7lTCw6uvoQHA87BpvW3zTEVcSf71WruyH+CqMlJ55MwemptZ1CC+JErPJO2cM6tA2aDIyb6CnMhJW0vqajiGtx10nhfOIWBFb4Ojxn3gMd4J3XaVv5st3btSOZrPLwKk7XlwD1h/x/+HXlgjiIQALejL4Fpok7ThYVScUEo9lxqiVP5bmOmZ03x7d4ROckenNBJzACYkNJtSseI5p7ha8fuqXG9wBKucI+ZZxDm2iwV1uceIVlzn3KriZAXbMxmZy2AxPQfjZ4z7ErRZBqJXRWv3eo+UNx0FeVHYN5liBTU8mrQHdSny2xjoP/lhy2rOBR+rWwAnI599I1OXe8PZVZaKrkKJ2DmckA6oIUfUv9vRlYU2V0jMLS057tFo4op3NOgyxFBzeDK/RrU6EYS0QnsMrz1v1mrdjUpMZY/yxMfDB3a5uhgcwoY8KQ3Xj+DqYSKHxoBBw1tRdwswHw9lWvg8n3g8utRJX0kskm6iZ5JOcTCuFVr4t5vkTSva/CZstTJvC6AeUa33a+eL4tesw11bTmX5DNBYP47DLXt6tHqsUauVmLn0Jly/SNIFkn6GRrflPqyOpnARDtLfrDizywABGbVN+vEShcE= 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)(376005)(1800799015)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 12:50:30.6093 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4bcdb0a4-c498-4e62-518c-08dc684af3c7 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: BN3PEPF0000B370.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5635 After removing architectural code the helper function acpi_numa_slit_init() is no longer needed. Squash it into acpi_parse_slit(). No functional changes intended. Reviewed-by: Dan Williams Signed-off-by: Robert Richter --- 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 Mon Apr 29 12:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 793416 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2084.outbound.protection.outlook.com [40.107.236.84]) (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 DEE99745ED; Mon, 29 Apr 2024 12:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395041; cv=fail; b=I2LPcA9JYxp4Gv7UjVdiuEfEHd0Lq/AZZhHOgW4hm1DMnhHyTbEQkCO8PpkY0DRnKoJ+s82DzH/FFy/edjqhAe0mB/+/KpDezK6kbTgCBY9jaShDTy/aTi87TyUr//2QLwbjlrb0ihl+yqAQlTHvpTvqtQekN/n8h76uGmEjrOs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395041; c=relaxed/simple; bh=GGVOQyQcshRXGn7vgXDtIcG0ullrNrrKkucC9HaihuU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CjZjLWM0Of3ekTpBnSBBew4+ZpOj/bVVPm5SgxMd6Ii8r9ec5JC2old4nh+qQwmk6nyxqV+Pij5rqoGDnPiKNZ1wA9gpLTRmpI0ThQ+TjS9ZoayH5Sfn+W9KBN48CkI/m9rG6BYeigNOy3FDYPpv9THqiLXFiXPzEushphJloGg= 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=xmubwddv; arc=fail smtp.client-ip=40.107.236.84 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="xmubwddv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7MWsxpxoSxoEGBtxsLFbKuus79x+QcifUDgRfMGFAhQRHBtukkJxriMCBGkEepT5w0gm8BsEAfWuO/dElvzRJpz49xF3wLWCFmeYFUnQzaxILR3lGstLZ6O1/KdSslUJ6KfIqHHZfaSI6IfE9QebnEZv89EHGBBK4/BvqXfoz8VHktR3zRoKEAnzuRa7DkoOnw73ib+mW6Y7ZydxIE6hakYl5FNzrEBkNh++EseG+BWFzyBAvR2Ff2lqwgO3AGfJ0W0iQDvDBf3q2rYHqQBY+w5fIgS5Z63VNgKPGrGOTRSlZtjOJXPU77UMlXVTcqOY6DlMSMDKpv70LZsf5Br4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rkL7D3UE3FQj+F2O0O6sABtRz51PmXjFWY+kdAxvrYk=; b=ggxpZkpgtvQ0PjdXDU17GTz/YDyMLQL3sGzocybybV+lf6mUcRpz57KMyhNk0csDyNNXK3E0fIEHrz8yd5+AqzCcrV1gLRy14DqcUP6VXh60J0Q1wBjcqkeKsGVG5BOg68ITipvl46RNhV7ZnzUSdJ2jgrCcZa2DL9nG/9vlnrfmxF4TZ2m0IYPNBgYaF6Yxh27pj1OFvbMlAtiJA08devlL+1kC46q7nakF8Tt2lg9nCpjOsPgxYPQQ/6aTbMql618L3ee+FcwQyCT9z9GMFX+z2ki3XINVQKPk3da9csxxtIsazc7zNod5mxZsrNnI4JTx3ePtCPOBcy1RRDJNuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rkL7D3UE3FQj+F2O0O6sABtRz51PmXjFWY+kdAxvrYk=; b=xmubwddvKeqD2Wx3LUlPCRGFcWkns4lx9Rj83aeQ3D27w9lQ8mmjKaSw1iEF2uihshdLZOUHZ9M5iO0BNtEuF6PQja/aB90wQjfKyyFtxssP8ozlWDjLr0kY14yc6fxJa1xX4MOZ+F+vwFCNPtzHNfWC6Ajkb+p+nlseYBAQbiQ= Received: from BN9P221CA0023.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::11) by BY5PR12MB4274.namprd12.prod.outlook.com (2603:10b6:a03:206::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Mon, 29 Apr 2024 12:50:33 +0000 Received: from BN3PEPF0000B372.namprd21.prod.outlook.com (2603:10b6:408:10a:cafe::b8) by BN9P221CA0023.outlook.office365.com (2603:10b6:408:10a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35 via Frontend Transport; Mon, 29 Apr 2024 12:50:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B372.mail.protection.outlook.com (10.167.243.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Mon, 29 Apr 2024 12:50:33 +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; Mon, 29 Apr 2024 07:50:31 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , "kernel test robot" , Len Brown Subject: [PATCH v5 4/7] ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity() Date: Mon, 29 Apr 2024 14:49:52 +0200 Message-ID: <20240429124955.2294014-5-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429124955.2294014-1-rrichter@amd.com> References: <20240429124955.2294014-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@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: BN3PEPF0000B372:EE_|BY5PR12MB4274:EE_ X-MS-Office365-Filtering-Correlation-Id: 8da6316d-e169-43db-04f8-08dc684af59b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|82310400014|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: 6qKijajPGX2AnymXaXUBfRqrH70NwowfTC8sHafB291IGhX6VklxRhzfkCeaSkNSJVBMqQFvbHt2s7nXSOCv1cb9CIRjr8opCLSxrN6CjrkI9QlaQ9xZsOCDM+uipxEQaPffU2w41qpEa1LvHnOzlBPTnspxs1hHaABj4MwPAj+O4eA6ZznROWGZ6xQ9MbCcT0B0xPvkpCRhUWiCEsrjt3nAZ7IiNUpCpm6debrGvV4wSddRqfcoMY8amIpWbm14qRUaPNg9kSDSkdU/LAtoR1BnI67VAoSW4DO5q1WUmMNmZ0TKFGrQxh46w3mmkexDQKqsHHxDvEOQYgU1ER3KppNpF8PGtfbx05j6ThbRRZXKnzYUd+wuxr/ktnRfaDtomXmlVZdxftdnDV32e5CsYt74cEBbBl9nYPyBv4fqsMIrMq3veIWnQB3BcGf8sK8Ez3c8K2UvDniJjjBrAy/VocsrcuU+zmiIAJHYhOG7TthKDKxHIVMdibM6fkdQE+0X/NNT0xtaRDtQ+57w4la/BPM9ezKCQD5jPWcNnFsOoMJHVl24kpBkM9hUYVR4zLfo+jVfwE6Lmhq8Rpc7tQdWI8TKKFAaQGiUKIIcxMYhiV6j16BuJJE7tr8qAl3H3d0LgKhGZam7LXwr71J6Mz8fbaOhCKbSaUcImGrHMjjDzB3eqlOrsxtZnGgL61vYASPAFHgiUq9OoS/A/5YRwTx0IYr0dm6YukCgQhbXmw38BpiDNnQxYEG09TAy9IoZ1cQK/+H/EP4X3Lr9vdj3ILir/zfwwZHjwr84KyhPSMA4Yzp0D1nUSlLpE6Q3yXEndrjDyWXwOJEYsQLiSTtHM1bTz7Xa3Mc/rChXnrGNAyQlU3CVpw4XS03IXSUtmzpiRvAhYiKnNFVLB9tprW28dNH8AwQeRvuGkrMb19sany65Q9wRCtFrkT9U/tmWTja/L/QkdE3xUc4PGCGyiemwow+x+gYW8Ot04W7qKHfG9rh2sYvFKp8qGgcQWSfZFrzZ3KnbJPsuc+1VltTuXbLlbQwpBji5RO/sWYUU0+Fp1eJOSFaCoSRT4Ubsi1VJFusFe7CnqR6B3Ms/N4aqv7W0TaK+an1uRTRVqmKwxVvnc+k+C8Ce8h5QK1AYbLqn2DSElZzt1WeF3BGCmg6xotXAmmhohEwjyG58E9fQl8XxLljuJdgUjUIqgYvJvYrvdXL2IaPjYNBz82eZgkF04kutOU3EBf1MMDg9T4NCRLtIwwU8nFyZaMsHmrgfQ/qb4+zexZq3EIUle+APWTE2NYnIcJS1pC6MfmvXlQnrFdQjFMMsmdBoWLGcPka7sSz1tmbQ3FRN 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)(36860700004)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 12:50:33.6744 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8da6316d-e169-43db-04f8-08dc684af59b 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: BN3PEPF0000B372.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4274 After removing architectural code the helper function acpi_numa_memory_affinity_init() is no longer needed. Squash it into acpi_parse_memory_affinity(). No functional changes intended. While at it, fixing checkpatch complaints in code moved. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202403220943.96dde419-oliver.sang@intel.com Reviewed-by: Dan Williams Signed-off-by: Robert Richter --- drivers/acpi/numa/srat.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 430ddcfb8312..e3f26e71637a 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -248,22 +248,30 @@ static int __init acpi_parse_slit(struct acpi_table_header *table) return 0; } +static int parsed_numa_memblks __initdata; + static int __init -acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) +acpi_parse_memory_affinity(union acpi_subtable_headers *header, + const unsigned long table_end) { + struct acpi_srat_mem_affinity *ma; u64 start, end; u32 hotpluggable; int node, pxm; + ma = (struct acpi_srat_mem_affinity *)header; + + acpi_table_print_srat_entry(&header->common); + if (srat_disabled()) - goto out_err; + return 0; if (ma->header.length < sizeof(struct acpi_srat_mem_affinity)) { pr_err("SRAT: Unexpected header length: %d\n", ma->header.length); goto out_err_bad_srat; } if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0) - goto out_err; + return 0; hotpluggable = IS_ENABLED(CONFIG_MEMORY_HOTPLUG) && (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE); @@ -301,11 +309,15 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1)); + parsed_numa_memblks++; + return 0; + out_err_bad_srat: + /* Just disable SRAT, but do not fail and ignore errors. */ bad_srat(); -out_err: - return -EINVAL; + + return 0; } static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, @@ -438,24 +450,6 @@ acpi_parse_gi_affinity(union acpi_subtable_headers *header, } #endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ -static int __initdata parsed_numa_memblks; - -static int __init -acpi_parse_memory_affinity(union acpi_subtable_headers * header, - const unsigned long end) -{ - struct acpi_srat_mem_affinity *memory_affinity; - - memory_affinity = (struct acpi_srat_mem_affinity *)header; - - acpi_table_print_srat_entry(&header->common); - - /* let architecture-dependent part to do it */ - if (!acpi_numa_memory_affinity_init(memory_affinity)) - parsed_numa_memblks++; - return 0; -} - static int __init acpi_parse_srat(struct acpi_table_header *table) { struct acpi_table_srat *srat = (struct acpi_table_srat *)table; From patchwork Mon Apr 29 12:49:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 793045 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2047.outbound.protection.outlook.com [40.107.243.47]) (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 CD71A74BE2; Mon, 29 Apr 2024 12:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395043; cv=fail; b=tNOibZa3TA7SrjNkByUxnBbHIm8Oajp9a1+vR7Uj+hETVPxAX5QMkaj8ThTTVA4g1Ds9Jjz6dWxFJYab49EJy8W0Rb8GWbuveA4TH6zWMP4We9WvykPPaaA5IUtWNdoYh74sznvP3fUWKEjiWiQGGV3ptlKwuYEqNOYDzt1S3nY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395043; c=relaxed/simple; bh=Ue8WH4C9GLmmniw/cZeViaqoValVaj+Q6uEWMvcoUPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iWjIz05jGrXpH9QatpQaOpzE4fbdQ5RXrU29N0vSgq0uFbNYxtXtmiJeu4ghakbJBrjIXKg1Ew1GWysytadE/FMbC/4EtcTvY1Lq4mZ2LNO41QWkRFoDyfJ6evDjKCy4phTQ2QQBM15uWokAAGhvSsRNkUckCMKhnxzm7PUQX8A= 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=PURPOcxF; arc=fail smtp.client-ip=40.107.243.47 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="PURPOcxF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYp17BgePeoD66MmU+6g6uOjsSh7r9I1q0J1JN7s3LET9VR3q3c50VlKPWgB7Pd1GeUiz1N3Txvt2PYsV6PABo+uZQvcEPTEjesBieSgJZ9vbjz65ccNLVL9Q/OQcWsZv0wExeuRKkOHHW4+U0a77wYgSYLTtvWw+IFiFfPjE8Zc4BtgTx2o7i6yDtwdg7NraX7d8TLw253PznZXXxKEAD/TJf6BmFopY/tDtF0n6VB+pyqkFj71NBxwJIOdKJbOCGBceWww0F9ypZv2CxvL1sQDTzp2VrbSVxB4Lz5nniBsYwQOKQFs5I+LtWdQkrVFTNRKHy9CClTOXwE+mNHOAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WYa3HjH45tLeZst82FHqztgFJXWtI4K9z4B5DEry0aI=; b=VtZhANzL2sqmvjtQZxhWZ7vhwUn9zmQN5YWLOwf0S5YyfW+kfohg+MuaUs6iTmfJmPfy7NMBmXboorHXEtC+zhh/CT4bO2eJk8BCqXI07HTy2hyQlO2G6dVwSzsmNLPGTe5VXm1jnZO5KPrA2Joi5FHOKISOg/PSFRZGzcHQr8GhYjMo7bsdp/SXnoVs4jetVRW2dRg3POiIVObg/nITKx2ERrwxd+eJLKzJg2/LldNKGPr29vmEhfi/b/QXSpirNxpRcg/fyRpvFYjvpDC4i2zpDhxgFD9IHCX1BN25PHzAu9dO7zYg2kPB2UW1LVeEi5NgIE+5qdRCPEZUVKHyeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WYa3HjH45tLeZst82FHqztgFJXWtI4K9z4B5DEry0aI=; b=PURPOcxFvDdZESbT3WqUz5CQckJhKp/nMNUjji0yNxphmxDSqN+7Jbj3SdSg7NrHBYvbhsUyH3dRjyI9AFInhtE9aheQEmC3nTDHeWLhrZ9kc8aEJU7XvbAoMlc75uypjJViN/4UTw5lwXZm+TTOcqXQUpHUVaQor5lJN/C0RAs= Received: from BN9P221CA0022.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::14) by PH7PR12MB6393.namprd12.prod.outlook.com (2603:10b6:510:1ff::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 12:50:39 +0000 Received: from BN3PEPF0000B372.namprd21.prod.outlook.com (2603:10b6:408:10a:cafe::ab) by BN9P221CA0022.outlook.office365.com (2603:10b6:408:10a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35 via Frontend Transport; Mon, 29 Apr 2024 12:50: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 BN3PEPF0000B372.mail.protection.outlook.com (10.167.243.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Mon, 29 Apr 2024 12:50:38 +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; Mon, 29 Apr 2024 07:50:34 -0500 From: Robert Richter To: "Rafael J. Wysocki" , Dave Hansen , Andy Lutomirski , "Peter Zijlstra" , Thomas Gleixner , "Ingo Molnar" , Borislav Petkov , CC: Dan Williams , Alison Schofield , , , , Robert Richter , "H. Peter Anvin" , Len Brown Subject: [PATCH v5 5/7] ACPI/NUMA: Return memblk modification state from numa_fill_memblks() Date: Mon, 29 Apr 2024 14:49:53 +0200 Message-ID: <20240429124955.2294014-6-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429124955.2294014-1-rrichter@amd.com> References: <20240429124955.2294014-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@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: BN3PEPF0000B372:EE_|PH7PR12MB6393:EE_ X-MS-Office365-Filtering-Correlation-Id: 34f6ad2d-50a6-4b8a-1c03-08dc684af8bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|82310400014|1800799015|7416005|36860700004; X-Microsoft-Antispam-Message-Info: q1S/1GS+1mK0jkMuZH9mYJUY+a1ehKwZzbMalSkjZsAUm05yCI/xi+xjQcLz9npY4YEowgSB+nrsxWLwNfdYTdCmUymjVYSvrR2zXEK8NCHZ1UJG0COhPuh5HhYSXT20ZMMO4oCXvczsqiv9wicDvQD0PvMCcjmONt8vyW96P7wj94f8Ci8ivFNlildahmGTCYdwOQkFbKMEGi1S6LNvLblKVQYsqWSw8uqMm8w2GZUeHdR2fny1+OctbP/HmhjUrQfGKSqovt9StHN3d8Tvlyt1XLx9MbyFzv6CK66FW2iqvD9JEMbxDdxrMoBntmk6z1FxebomuZq2IAt/uMub6hGqj3WQWsGWEAZ+Hi5PdFLSjc3cEd7TIFnmm2WeyYhoEkE+kv4oB5coq024gcnQ48tbSQyiwL1nRlC5c8c95z0fx7yQJ91Y2cVMMTY/cv7FopwcgRsIvYbY9EWsFj6anRNGh7hTco7/4Fprj0iKou2HK49mIo/a5rdQEcUoMZI6CTbwMa2p2A2HsHS4RdUQwKRX2B8careN6ZWwmhuB37r2CxmsZINfOlO6ETL1U9ok9M0Zt018oR6YGEez/sqt8SaRtFAK4tHxsUrJHBIEoXiGO0ZkHQXapSvh0r3h3fzLF9YiqlzfC/oBROGPX/bxhXwRdULiSCiCSYdowJOR+7aomZYBtXvZqnH34iou95KIUuGVfVzG2No7wdVTifP1+NMt+60STJ06n2jbSPwKTHrOyInYM55GABNYc03RfAAg+YDbxeHbQltBnff9Cn5PiuVHHBhKlGo2Z8HDqwa8+mBzG+ocyZG0SjiLFglXFD0RwiujbV6aj4nvsE4DzpFcZNAZb8YxFwDHkI2F+TweCstL1J2WGCDV5rIrZEy6Tk61kust1aSqLLDV8HjvdImEQJhhs1Rrl4HWNvlE/QQux75HZzvdU3ae1mrZ6/N5CqHAGE3WB0SmS9S2NSVJRejH5gxeqcuOcLr8uTd3WVmiUb8PFTZTUDsh7WrbuD3FyCeLYNC8yYKAq1LfclyndXzA4Vy1w/wiOoXSOk//j8vv/4vltVm1AtgeJzR0GwfVWKtjgVRYFf+sFkKE+y4f50Y5+5dIJkPTdnWAEpBxu1EXqa2SRvvqRHCtvbZZmV+1ulPXo/MV1V2GqtnkxTvzRg/z6raiQN8nomMjKfwu/tegNHJrEbBfE9ru2osZmLGWDIHpvAHeViLTHKnqwIUEynSyFzFXjUaNWAWr8gQBPwHegBNTDjkLrd4W2Rh41wwDyuMjHAaOVwR74ALGBmX2gy8OTKvYVX+PrYXboj5rgMKI6RqF5udeDuD6oe8UQCAy3ja8 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)(7416005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 12:50:38.9245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34f6ad2d-50a6-4b8a-1c03-08dc684af8bc 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: BN3PEPF0000B372.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6393 When registering a memory range a possibly overlapping memory block will be extended instead of creating a new one. If both ranges exactly overlap, the blocks remain unchanged and are just reused. The information if a memblock was extended is useful for diagnostics. Change return code of numa_fill_memblks() to also report if memblocks have been modified. Link: https://lore.kernel.org/all/ZiqnbD0CB9WUL1zu@aschofie-mobl2/T/#u Cc: Alison Schofield Signed-off-by: Robert Richter --- arch/x86/mm/numa.c | 33 ++++++++++++++++++--------------- drivers/acpi/numa/srat.c | 5 +++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index ce84ba86e69e..e34e96d57656 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -950,15 +950,16 @@ static struct numa_memblk *numa_memblk_list[NR_NODE_MEMBLKS] __initdata; * address range @start-@end * * RETURNS: - * 0 : Success - * NUMA_NO_MEMBLK : No memblks exist in address range @start-@end + * NUMA_NO_MEMBLK if no memblks exist in address range @start-@end, + * zero on success without blocks modified and non-zero positive + * values on success with blocks modified. */ int __init numa_fill_memblks(u64 start, u64 end) { struct numa_memblk **blk = &numa_memblk_list[0]; struct numa_meminfo *mi = &numa_meminfo; - int count = 0; + int count = 0, modified = 0; u64 prev_end; /* @@ -981,25 +982,27 @@ int __init numa_fill_memblks(u64 start, u64 end) /* Sort the list of pointers in memblk->start order */ sort(&blk[0], count, sizeof(blk[0]), cmp_memblk, NULL); - /* Make sure the first/last memblks include start/end */ - blk[0]->start = min(blk[0]->start, start); - blk[count - 1]->end = max(blk[count - 1]->end, end); - /* * Fill any gaps by tracking the previous memblks * end address and backfilling to it if needed. */ - prev_end = blk[0]->end; - for (int i = 1; i < count; i++) { + prev_end = start; + for (int i = 0; i < count; i++) { struct numa_memblk *curr = blk[i]; - if (prev_end >= curr->start) { - if (prev_end < curr->end) - prev_end = curr->end; - } else { + if (prev_end < curr->start) { curr->start = prev_end; - prev_end = curr->end; + modified = 1; } + + if (prev_end < curr->end) + prev_end = curr->end; } - return 0; + + if (blk[count - 1]->end < end) { + blk[count - 1]->end = end; + modified = 1; + } + + return modified; } diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index e3f26e71637a..76b39a6d3aef 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -326,7 +326,7 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, struct acpi_cedt_cfmws *cfmws; int *fake_pxm = arg; u64 start, end; - int node; + int node, modified; cfmws = (struct acpi_cedt_cfmws *)header; start = cfmws->base_hpa; @@ -338,7 +338,8 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, * found for any portion of the window to cover the entire * window. */ - if (!numa_fill_memblks(start, end)) + modified = numa_fill_memblks(start, end); + if (modified != NUMA_NO_MEMBLK) return 0; /* No SRAT description. Create a new node. */ From patchwork Mon Apr 29 12:49:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 793415 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) (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 6A02B757F6; Mon, 29 Apr 2024 12:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395045; cv=fail; b=JyG2lwekylQ00QzaQD2eJ1A0TSICKmDUMaHFUBc7zKFqKajQE3jfHeBBeI3dMRdetRShLibvsLAjPnpmZtbySFKX+21Adi+bVRUsS/KMD9MsjJOmkvp/OXEmvy3NjrU4VX6s3aZka7l+olNuWTL22dh13Bzkuv36MwHC7sMrHXY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395045; c=relaxed/simple; bh=vYp95VMxzdzoj/DtrhF05Qgt5E0e6xXnhOR1Zpsoc+s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aBwVJmTeUCapiCUrmJjScZlKd7AJ3LBom/Lo8/NneZr/EO7HffKq5kb7QzmvBDzxVxlNILPPdGYFl8cKelEDxmZC+4oz9qKYIFhv1ivAjpmpWOLWZZOS7FO0WkiStuHsRKOmNKclCA2lNkVqkOF1myFfV+PzXF8hCZYLqa4P8vs= 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=kPnEuDxq; arc=fail smtp.client-ip=40.107.237.61 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="kPnEuDxq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FfUtuB5qTweAa8aQ+byWYXuz1r4hMVi/52skh4qDugq8P4K1Q50Eqy5nPjg93/V6DYXTM98up+tNCltJtEctWCyfQrI+Iku3/HRb9RVZdzHW0rVhQH6SsQsTs1yhUKJuGXEVUJ1VdwMfp4uRx7wqcGgqfM2/4mYeqGRrYUNwx5Q9rjpB7q42smtG8rgAgi0LUW34nO1vGIm7zpe8dSZfIjCJrfQyiHw5cRHTCMf3KaXOEIuyqfKKsEuHIsrsmtxLnalvC5fzGL8OX1a/RX97kXsyw5jW7mdG5rUzppbL0MrhqCnOCj2XtLlJWoIpw1Nxjw3zZK0HL0aFqCN9tE1bow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZZxv3bUK3ryD91VcL4/Kx8BoqbMa03THTNbV5ekodRY=; b=ZoD0y/REKq9/9XgHlqwlctdIiGByRJLIqT0pIzscwQUNeZLN+uiOJ6jBKiWhbZBEx2jt5iKASrXCOwzEJ3DCGUaKo2U7FOnbP0LAmi3AfLqg/99OOBxXAoPXf30d2Ji/LtkYt9LqTXTMcPV+oE4wc2QBu7apYyzv7N2Vf+Imgz1tCK21flO5OfBM0TUFcmtEVjFPEBiDxaaS4W3qCENmfg4oOE11IQcOGcRJlYYBwrmQ0WbHD2ZtHsQXVuLwMhPrJI1JfNFFo/bAXaeKJ1WvkYNDLcvf+DYubsiXsl0i8k6Eb744Wi/KNQIW7qh8h3ewwsR832ROM+0PmfZb+n0ZGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZZxv3bUK3ryD91VcL4/Kx8BoqbMa03THTNbV5ekodRY=; b=kPnEuDxq5aWaoOs+gi/EIlOmpP8ujnZe9WdNwJqBGwI8wdny11UNiErizpERSDSUgsMgnBzVX35RVBTWu4UsAI+tE/s7rjXNhba0IE/8TmVi1CGHNnuW3lTzDJknF8rpNr3iShoQHpnWHE0tqPik4p6gfG7WjYQYlqoDeXOBbkQ= Received: from MN2PR14CA0002.namprd14.prod.outlook.com (2603:10b6:208:23e::7) by CH0PR12MB8578.namprd12.prod.outlook.com (2603:10b6:610:18e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 12:50:41 +0000 Received: from BN3PEPF0000B371.namprd21.prod.outlook.com (2603:10b6:208:23e:cafe::e7) by MN2PR14CA0002.outlook.office365.com (2603:10b6:208:23e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34 via Frontend Transport; Mon, 29 Apr 2024 12:50:41 +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 BN3PEPF0000B371.mail.protection.outlook.com (10.167.243.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Mon, 29 Apr 2024 12:50:41 +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; Mon, 29 Apr 2024 07:50:38 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v5 6/7] ACPI/NUMA: Add log messages for memory ranges found in CEDT Date: Mon, 29 Apr 2024 14:49:54 +0200 Message-ID: <20240429124955.2294014-7-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429124955.2294014-1-rrichter@amd.com> References: <20240429124955.2294014-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@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: BN3PEPF0000B371:EE_|CH0PR12MB8578:EE_ X-MS-Office365-Filtering-Correlation-Id: f8572fe5-308b-4d2e-7058-08dc684afa1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|36860700004|82310400014|376005; X-Microsoft-Antispam-Message-Info: YZD3PZig3V7Y5jxJdFx/daOSDPOSmDOQ+d0ugdoE7woI6EmLbkN8tcVYHB5t/c36yRA6QHYkks3wV64C7X9qJzcAEMbcKcHtigbofLpoRWOG9kl9qA1EyqZ/YknqalUPrXXKDzug2FhmKa6/2EYsWGP+b9YKWBRqdZ4sNR3ZvcEQXRoMMxjXtK0/QOrK69OIBZw2VjyldbMZiRNNaSrx0JrzPEvZsuEbds5Fe0gYtTxFAaOK3OuG4XW+eEtgBrN3del7gsQL8DYc1KSTIlK/M/LvpQ56AZWDAEGxlwdIkRYcJAZnDQZ589tegpL2rorVOAqHWMoxIv6M7CvpWANzZ6gm5M+in9EQNW3jA4FmtfWHlo10Sxr3xPL0JgLPCZOP2NBqs3fnGDtqxV/gMYqW6CK7IIdHUtSxKrovaqA4Ffd7rit6oXHzMT4EHcqMjuJpGt37U8Q3VnTvsoaBVju/VG47I5dilsJUNcU7xV/HOcwHwwSBC5BpvjTuCkmMfAcdB9BDqSiWsm3rE7tm8DeZ5NGWJQSo480+Bng78LnMRZiPn2c/4uBo4aIqP7WD/uunh475hqQbD1OKlNms2hM+Vhscih9jT8QvIcPRNeYrmuFGHlVbHSfM1pZ/xQbrB9LaRuG+WS0wgRuNqYJMRvGg5tEN7kA+imIhVujfur/vxt9Euu7GnCczwRTHHcLR0jspq3Dv9CH/Uuy44hERqMM4uAjRb0SDXHlQdv/Z1/b3PCYV5ixHW9InRbQQ9pzBKP4VcMc7xv0all51lg09T9gs3EHL/Ki6ODaMgzKxMVzW3cP3tLTEIDnYP0l4e1pyWUtZ8iE/5bbik+AR0UrogDVEsqUovLOW3w/ozllkexs54kpxDMOf67Ldz0wkf4/n/xcsa3L+eCqafLYhkV9Xx0c4W3l6/7x79cQVaOitcVJYL4wxB5nh7Q5+tbAwbke0Q3dIzwGobP/kx/XRnEr8LPYtoNVHfIH89ktiwIu4uX9IYt1JtRY+uebrigQx7vz/5knRLmfktrzXs7pxre+vl2Nd0p5u4UoWAeaRA1z6YY5Md10P5xIlUeEpr0kif55lqUloM8yR9EFw/ZcLMM9cOlJJDFd+VMS/wky7pzXJTrGdq6c64q8QR5yw2wruqCeD8SIJrZVmJ5lLyvAHyjP98FWe56ncNtIfDnKY10+ns8clxnYd+P2JUF6Qg7aVx/zOzDqyxgYibwxTGGvNUhZc4tbabjsgWG+wIfDPxMJvnUZHY4lIlwrRIXvOJL216R58iW6mIjoda5gxWgHECbbjRBYIY00XbNbP3la5UvzxHd1DkRcE/ExEL+6fQfwsK47HdLhaFl2JO27bqOaVnAQgvh61McLJCxJDViDj7d75Eo2CaYjKWn/sEGcYTLvdZ+dtP0qZ 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)(82310400014)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 12:50:41.2532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8572fe5-308b-4d2e-7058-08dc684afa1f 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: BN3PEPF0000B371.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8578 Adding a pr_info() when successfully adding a CFMWS memory range. Suggested-by: Alison Schofield Signed-off-by: Robert Richter --- drivers/acpi/numa/srat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 76b39a6d3aef..34ecf2dc912f 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -339,8 +339,12 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, * window. */ modified = numa_fill_memblks(start, end); - if (modified != NUMA_NO_MEMBLK) + if (modified != NUMA_NO_MEMBLK) { + if (modified) + pr_info("CEDT: memblk extended [mem %#010Lx-%#010Lx]\n", + (unsigned long long) start, (unsigned long long) end - 1); return 0; + } /* No SRAT description. Create a new node. */ node = acpi_map_pxm_to_node(*fake_pxm); @@ -355,8 +359,13 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, pr_warn("ACPI NUMA: Failed to add memblk for CFMWS node %d [mem %#llx-%#llx]\n", node, start, end); } + node_set(node, numa_nodes_parsed); + pr_info("CEDT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n", + node, *fake_pxm, + (unsigned long long) start, (unsigned long long) end - 1); + /* Set the next available fake_pxm value */ (*fake_pxm)++; return 0; From patchwork Mon Apr 29 12:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 793044 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2042.outbound.protection.outlook.com [40.107.236.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 51B5077F32; Mon, 29 Apr 2024 12:50:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395048; cv=fail; b=qyQqIMnkMv6kI0ZXzWvTbp13Oy5Ex2BHA1y1GhOMuOVVYOHnp3mq1VZgXQpq2/aWaBNFHsjFUMhIlgsiExhN6JpnhVv/Hpieyc9u7x3rCyKT1StJ7jx+0jHFjyFE3Su1VugsDQE2+buGU6Blu/q+8BUVsaKFAhS2O9YGugM3Qsc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395048; c=relaxed/simple; bh=xu0ScFGHprQXGjeUjrlrMdsxsUwApZ59SWPq1CbOlj8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dIZHGIDhr2/xTg+sEKjSOIpRPUr6ccQNXyXLII+Bgx+wBqyXhsluyQ4rwCG8btfIr/Wgnf93oNWbZ62fd74R64BVJqdfBdA/BWZNc7ORNq6lX/my+NyZ0IhlVhWW/KX6AY4dbFNMJl4UX4bE2MMELB5yaSq4k7njetCx2v/iTGo= 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=YMV+j2UB; arc=fail smtp.client-ip=40.107.236.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="YMV+j2UB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NdaLFMI4M0wpFtgx5GMtv8M1yx+It5C2s2tfG+RyRhYtzQCC8vQgGwsdpkmQUQ5fwWdPXFysDXB+tcg8XMEQuXaKixqpKyiRtJJdvqjTUGP+vhxruMOHlK+mdGSttlSj6N1oKDRe9BgGDMB2J8Gw6zxPLm3mpu5Pamkx+sxENPSmYFAmgzcTPZwM2gBoeyOg/mZbC0xNnntCt+TVN2sKCspXkQNFN6GsOKD4saPEOC4O/Dyf4iQ1/LPwKkfB6K1sZAPOfCBPFTADsBfV9AfOG25NN/elrxpxILZM4VJkcZlhxT2CnsJpAm3+uFRsBHhsregnTV8j01nG4lHnXRPO+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=auFNcIrPvH7HK9lxyY6YgTh7dndOSGd2/26TlLLxI9s=; b=HNoqhNIp4cBLrxLJ8yqcJTM0yGUUxJaJOVzzRf2Ml/fRBXCeECdDv1r7LxpyQieJt/jVmpCsbKBUOk76I1HEiItlqsLavGjGTYi+IV2toSDgoSVjdLIkdKyfAXr8ivROiwp8+pcQoZxBZWy0+ZX7kESdPQlxwGb+6qqMEPBmx0tw8b+T9KsYpRJfkkkUOTkTKi5vrLrZ2ySY3qzCiFDfVt96rUF7PGAd6AdN+2YCRPZvleTFYa8sxkYMGV6zWaMTKCSJqX7pKkOk/8QhUf6d6rsUxlZKf79H7AsqWUBnJ28FMko254shP6Ghty70eRiBlFX9hrzRmabRNZ3/6S9iuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=auFNcIrPvH7HK9lxyY6YgTh7dndOSGd2/26TlLLxI9s=; b=YMV+j2UBXNoKZ7WajVx4KHhl+Hjw0W/SH6bXsxV62MTa9Lw3cFJptvCeQ2Uk+T0JlXKrUXxnitkTm3w06XEyo2pr20GC5iZ1kSJjed2U5KkTrcRZDnwFk2E86TZxf1wRrDWzsex3N4kImUuEejx5991ixrFTFtgOS426mcIzkxs= Received: from BN0PR03CA0048.namprd03.prod.outlook.com (2603:10b6:408:e7::23) by MN0PR12MB6271.namprd12.prod.outlook.com (2603:10b6:208:3c1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 12:50:44 +0000 Received: from BN3PEPF0000B373.namprd21.prod.outlook.com (2603:10b6:408:e7:cafe::4b) by BN0PR03CA0048.outlook.office365.com (2603:10b6:408:e7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35 via Frontend Transport; Mon, 29 Apr 2024 12:50: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 BN3PEPF0000B373.mail.protection.outlook.com (10.167.243.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Mon, 29 Apr 2024 12:50: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; Mon, 29 Apr 2024 07:50:42 -0500 From: Robert Richter To: "Rafael J. Wysocki" CC: Dave Hansen , Dan Williams , Alison Schofield , , , , Robert Richter , Len Brown Subject: [PATCH v5 7/7] ACPI/NUMA: Print CXL Early Discovery Table (CEDT) Date: Mon, 29 Apr 2024 14:49:55 +0200 Message-ID: <20240429124955.2294014-8-rrichter@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429124955.2294014-1-rrichter@amd.com> References: <20240429124955.2294014-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@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: BN3PEPF0000B373:EE_|MN0PR12MB6271:EE_ X-MS-Office365-Filtering-Correlation-Id: 541ea7a0-c5ca-414a-b352-08dc684afbfe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|376005|82310400014|36860700004; X-Microsoft-Antispam-Message-Info: k+ieKL60/rDgFXHpeghkJTXxZz8eGj7jvk6AsY9Nh9+FSpbW7GEN+h7Slgj8Ul1VgaDmsO6jLg3LAIVlGJ11C+YwGqNaaIMdhqgd/urKt6p2H3PlY/vlUXh4aEGejH+OyOHMIoOMXWxZKs0uRFIwiiRWwsauBcNoyP9qpk6ym/kE7UfQGyyyTQyiH3orWZlOcPsocM+HKoyjQP8fSFpxdD1WCW7MbVmqXwBOi/A3lXDP730qIK+nzjXL0KFuBUktuXYe+v074N5F/vCbckqlJn5DgGE5G2n7Egx1vVNMP7za295KusKAra2lqIqVYkyRrZ6ovSBghqdQIThTxVPckjSEk5qN9GfJS+c5Nsx5vouEkcU6yqASqTh2whwGjNkEaQbhSawAmZg18WiY4CRPD7X5aKfdhF0UQd6wtW8OQwNZ+2I3ihcRPSfD7yhx/UHwN7eabX5LwGxC63uawSMUykiR/0UtBAwf9ZHgURBXJtQ3Jnv0a3PbQR9qj+ZGtC/qO4ifwa1hwoJP0W6BUk+98l83C4rF6R9G2SKT6XcrXqui3mMu35ANfOF/1NIwy48AYuIM/RvRFUntAk+QSmqkHzCK8mlJZq8ZDf77M2KnaTVDEzebaYCOcKQynbyoIf/pidPrmkxmqih9JszCxm7otB3gXl8HJfwaj1FixTvEq6uDzHBV2XAGi1vuGIjhNE8ByeX8/KzPGXs6Xorlwnrxz7TWQP+rrMbiXMruompR7sPXfiF7X3lCAjghbZllli4hOWE/m7S+4TdiwW2TaA5CCZ3yFcQdhX/TO6rEqdxr1fjB9HmMcZ86YW54/i+Ztm+qshUVeNwghc4IJsGzP56NdBqvoYluZgJx98dN62k4QA312BjnGEEdYcQeUtcB2ka/qq7cS1UsEZXQB33Sq8FrlC6T+Bj4dXMWse/RSY+JAgq+pwvs8c7ENgRNMY6Zr016nex0ZFLMSccy9RAS5yXWtd0GfpjQ8+6UYqkSH5O78jLsh6K1W0wcwWtXx04xyxAiVXfawiePk8ZRaIpwPl30xwOYcPSJKAJUCGn3b2z4AiYyrUUx22Ea1CgFcMWKkAFIrOkDtZ6zxMkFU6nZIMoiqzwMJmUBvkBHwqCAxblF5eVj6mmy96dW1qS/P7gjaEWZv9caYUq/bdiEDQ0My/eMCpoAuDScKozDNa6BAFGHRGTfAaIcdxEv4+PTLY1dD1oFmCmYplVG3IfbIpjMkw4GyLouGIr+VU/5nscOxe9RvM/1UHkq1eZJvf1PmuvlcqWjZQc9BgzF1UvcIRtenUZAofLWYog5m0WFNmx/ytqWDlt3F0Cv5i7dTHInkDorZwnN6iQj/58g+q9V8rx0/o1EI9UiVsblpzQnfF6kBa86iPA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(376005)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 12:50:44.3940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 541ea7a0-c5ca-414a-b352-08dc684afbfe 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: BN3PEPF0000B373.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6271 The CEDT contains similar entries as the SRAT. For diagnostic reasons print the CEDT same style as the SRAT. Signed-off-by: Robert Richter --- drivers/acpi/numa/srat.c | 111 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 34ecf2dc912f..fa21d4d5fccf 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -320,6 +320,114 @@ acpi_parse_memory_affinity(union acpi_subtable_headers *header, return 0; } +static int __init +__acpi_table_print_cedt_entry(union acpi_subtable_headers *__header, + void *arg, const unsigned long table_end) +{ + struct acpi_cedt_header *header = (struct acpi_cedt_header *)__header; + + switch (header->type) { + case ACPI_CEDT_TYPE_CHBS: + { + struct acpi_cedt_chbs *p = + (struct acpi_cedt_chbs *)header; + + if (header->length < sizeof(struct acpi_cedt_chbs)) { + pr_warn("CEDT: unsupported CHBS entry: size %d\n", + header->length); + break; + } + + pr_debug("CEDT: CHBS (0x%llx length 0x%llx uid %lu) %s (%d)\n", + (unsigned long long)p->base, + (unsigned long long)p->length, + (unsigned long)p->uid, + (p->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL11) ? + "cxl11" : + (p->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL20) ? + "cxl20" : + "unsupported version", + p->cxl_version); + } + break; + case ACPI_CEDT_TYPE_CFMWS: + { + struct acpi_cedt_cfmws *p = + (struct acpi_cedt_cfmws *)header; + int eiw_to_ways[] = {1, 2, 4, 8, 16, 3, 6, 12}; + int targets = -1; + + if (header->length < sizeof(struct acpi_cedt_cfmws)) { + pr_warn("CEDT: unsupported CFMWS entry: size %d\n", + header->length); + break; + } + + if (p->interleave_ways < ARRAY_SIZE(eiw_to_ways)) + targets = eiw_to_ways[p->interleave_ways]; + if (header->length < struct_size( + p, interleave_targets, targets)) + targets = -1; + + pr_debug("CEDT: CFMWS (0x%llx length 0x%llx) with %d target%s", + (unsigned long long)p->base_hpa, + (unsigned long long)p->window_size, + targets, targets > 1 ? "s" : ""); + for (int i = 0; i < targets; i++) + pr_cont("%s%lu", i ? ", " : " (", + (unsigned long)p->interleave_targets[i]); + pr_cont("%s%s%s%s%s%s\n", + targets > 0 ? ")" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE2) ? + " type2" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE3) ? + " type3" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_VOLATILE) ? + " volatile" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_PMEM) ? + " pmem" : "", + (p->restrictions & ACPI_CEDT_CFMWS_RESTRICT_FIXED) ? + " fixed" : ""); + } + break; + case ACPI_CEDT_TYPE_CXIMS: + { + struct acpi_cedt_cxims *p = + (struct acpi_cedt_cxims *)header; + + if (header->length < sizeof(struct acpi_cedt_cxims)) { + pr_warn("CEDT: unsupported CXIMS entry: size %d\n", + header->length); + break; + } + + pr_debug("CEDT: CXIMS (hbig %u nr_xormaps %u)\n", + (unsigned int)p->hbig, + (unsigned int)p->nr_xormaps); + } + break; + default: + pr_warn("CEDT: Found unsupported entry (type = 0x%x)\n", + header->type); + break; + } + + return 0; +} + +static void __init acpi_table_print_cedt_entry(enum acpi_cedt_type id) +{ + acpi_table_parse_cedt(id, __acpi_table_print_cedt_entry, NULL); +} + +static void __init acpi_table_print_cedt(void) +{ + /* Print only implemented CEDT types */ + acpi_table_print_cedt_entry(ACPI_CEDT_TYPE_CHBS); + acpi_table_print_cedt_entry(ACPI_CEDT_TYPE_CFMWS); + acpi_table_print_cedt_entry(ACPI_CEDT_TYPE_CXIMS); +} + static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, void *arg, const unsigned long table_end) { @@ -518,6 +626,9 @@ int __init acpi_numa_init(void) /* SLIT: System Locality Information Table */ acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); + /* CEDT: CXL Early Discovery Table */ + acpi_table_print_cedt(); + /* * CXL Fixed Memory Window Structures (CFMWS) must be parsed * after the SRAT. Create NUMA Nodes for CXL memory ranges that