From nobody Fri Dec 19 19:04:56 2025 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2071.outbound.protection.outlook.com [40.107.212.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 CF2F5204F82 for ; Wed, 8 Jan 2025 20:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736367954; cv=fail; b=t1JVSW0u0+c/SOJp03yDFxlpdx/4NCytSvQMVS5iB1GG5HWz7fxOjOQJVkSKY2F7w9CV2yJmXarr6ygkTmG6cG8FwPBqCoMbIU+KNM9TGh7Yk706G/q1pxn+bhLOkGy0cztwxyBoWrdnNhiZBTWki4NzHufuALr9cijBgSQ7c2Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736367954; c=relaxed/simple; bh=V3YKoq/7xSr3hPL6C2pGH4eoCqJ0LqFkwP2zxgSk6CU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kUjt+gP0il12fWEclRuPl9PZZvN8lpc53MWNagFuc/XrqRodwhHlCtFIZoeNdZ6vG33nkUPwX7EzaQWylxSkBZ09xX+EXOVXqVfZQrvo6mm9dJoaMUFM0qalW/o3VRAP47UAOXCWOifDYtfiFPrAgyTVv2vrIDNpAktzzI4oMhc= 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=BZoEuKeW; arc=fail smtp.client-ip=40.107.212.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="BZoEuKeW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LuBRkhMLT8wZ2UBGbAR/mu8qiLaIKm+6wJ1iqckPT7GOoIz5loeD9FjMVeDDuzHWHTB9YMtCHELOliuSoymJst02gtp9y6+wSS/bB4Yok89xWRgy8zzBtfhim9JvMgit9TnwvMGrP/pBj804dN6EWQ1lkCj4zLcUmUwx8YVlmENq311pfOgBa36sipbqu1hYROMwH5r3iAPO8Rr4UbgCMxRkwd6DKu+R3JRrxOLIEA1BO0YFwkmwFbCMZacUXBh1e/OwG4vohMocBJ7y2x9yMJWpE1ltmt1Ipw7lEUvYiqEcPMzz3dfJVx565tTBLCl4eGPADsS1P+IuOOrJS5aInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ir1GPm0WXRQ1zHn5rMMbhYE5bpimsWpTcSQjsJGnJag=; b=SpFYUAywhXkyxcpczcZ2gvPVt1302h6OphBnIsyYapVhWu5/xrKHHVzUEO4aTaSnLoxsU6GIlxj1nrXzhbJSkVqfM/FpXPJ8ZqeryPupwPNgQXCRCxHkrbqtqvaqUB3Clob3e3ifPCoEwPe5Q7EHpAIBo+yybpiVz62pzPv/gpLk49IuqzwD5Di3V8yub+YqQ51B96jSKszs7YIPfE9FxhYeHjzeqi6GUSzqsZl4V4sVSZSQuSkWE6xVJWqe+wlTxDjDBeGtL/AtW1JvzYFe9oRM4sNwh4Fi07YjBnrSSdjXqyFnrsTD7ZtTjdZlKreBcLDIAUcC32N9cDPcYEaBlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linutronix.de 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=ir1GPm0WXRQ1zHn5rMMbhYE5bpimsWpTcSQjsJGnJag=; b=BZoEuKeWB+v0BBZn7SfQSlX9niPw+O0U0aFWInstMZNGNFBi39zogqYdT3s5v+ewSnqOtK99fN7POXQHWaRvtUpml8EIUKPHLYJOk+5KELWfOAxrmLfN7n7X9AhgLxNXvCEpirqZRJpcBfRdUWkBPr11PWvsbQaLs/6EKNKIoYM= Received: from SA9PR11CA0010.namprd11.prod.outlook.com (2603:10b6:806:6e::15) by PH8PR12MB6938.namprd12.prod.outlook.com (2603:10b6:510:1bd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Wed, 8 Jan 2025 20:25:43 +0000 Received: from DS3PEPF000099E2.namprd04.prod.outlook.com (2603:10b6:806:6e:cafe::10) by SA9PR11CA0010.outlook.office365.com (2603:10b6:806:6e::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8335.10 via Frontend Transport; Wed, 8 Jan 2025 20:25:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099E2.mail.protection.outlook.com (10.167.17.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8335.7 via Frontend Transport; Wed, 8 Jan 2025 20:25:43 +0000 Received: from tiny.amd.com (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.39; Wed, 8 Jan 2025 14:25:39 -0600 From: David Kaplan To: Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf , Pawan Gupta , Ingo Molnar , Dave Hansen , , "H . Peter Anvin" CC: Subject: [PATCH v3 08/35] x86/bugs: Remove md_clear_*_mitigation() Date: Wed, 8 Jan 2025 14:24:48 -0600 Message-ID: <20250108202515.385902-9-david.kaplan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250108202515.385902-1-david.kaplan@amd.com> References: <20250108202515.385902-1-david.kaplan@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E2:EE_|PH8PR12MB6938:EE_ X-MS-Office365-Filtering-Correlation-Id: b9e3edff-4da0-4733-0269-08dd3022a047 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Bsci47KU2Bprgl0lEQ5oxnhvmEaLYbUlbFZ7GA+DbjxxXMR1wTSA7mOY7ni6?= =?us-ascii?Q?Wya929tEFkV8jpe/gZOBL5ubWUtj2+RDm6oyCxGlwJj7yvHCFRld51SsxMeg?= =?us-ascii?Q?0AXWeTABJa39Zj1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5DBlZJ5xVx7UP?= =?us-ascii?Q?Jgaaw1xQ6D+kh1o/fC8YX9QeLVdK8Lar5DGwx//iCvbALIfOLPYWD91y/er2?= =?us-ascii?Q?D4RZKr49x/53jdHNN0qbF0ViEnSad8j4X1CEErBVM3GvN4d5ICgth9+stZw3?= =?us-ascii?Q?XhNbBhEH9j77+eoadp9xv6UBWceC5gYj2nRpsnzBDbM2EoVgGIIHewCk4LJU?= =?us-ascii?Q?bUtIsg9WMxpV75LtC5S7wfYwzewiy8RrOt1r8MYqKsUy7O/KMR4bkNwwwx5/?= =?us-ascii?Q?u/GgPnO+T9zk/johOoBPlR8eus+zTJr13WzBOhdzYONLvPvj3md6BsdU9Fab?= =?us-ascii?Q?o94s+BkW5Q1/pBvJA0NtGCXER1GYRmX1yhWO7/Ws26mcWQr/MD64Bg91EBQJ?= =?us-ascii?Q?RQ82tBx5jExNYSi2qrOq/dowT3efvLmBsqM4YBUx5DyILpVHBBarETXtqrsG?= =?us-ascii?Q?vvifdgceyCsSVUq2pyigWLdeaFHpG60ikuL1HW9Z31w2dck0FQtfPMJM0VAn?= =?us-ascii?Q?aAWGT85/Gs76F4o=3D?= 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:(13230040)(36860700013)(7416014)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2025 20:25:43.1414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9e3edff-4da0-4733-0269-08dd3022a047 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: DS3PEPF000099E2.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6938 Content-Type: text/plain; charset="utf-8" The functionality in md_clear_update_mitigation() and md_clear_select_mitigation() is now integrated into the select/update functions for the MDS, TAA, MMIO, and RFDS vulnerabilities. Signed-off-by: David Kaplan --- arch/x86/kernel/cpu/bugs.c | 65 -------------------------------------- 1 file changed, 65 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 871b9f93b714..6c6a42b2dfe9 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -62,8 +62,6 @@ static void __init l1tf_select_mitigation(void); static void __init mds_select_mitigation(void); static void __init mds_update_mitigation(void); static void __init mds_apply_mitigation(void); -static void __init md_clear_update_mitigation(void); -static void __init md_clear_select_mitigation(void); static void __init taa_select_mitigation(void); static void __init taa_update_mitigation(void); static void __init taa_apply_mitigation(void); @@ -197,7 +195,6 @@ void __init cpu_select_mitigations(void) taa_select_mitigation(); mmio_select_mitigation(); rfds_select_mitigation(); - md_clear_select_mitigation(); srbds_select_mitigation(); l1d_flush_select_mitigation(); =20 @@ -671,68 +668,6 @@ static __init int rfds_parse_cmdline(char *str) } early_param("reg_file_data_sampling", rfds_parse_cmdline); =20 -#undef pr_fmt -#define pr_fmt(fmt) "" fmt - -static void __init md_clear_update_mitigation(void) -{ - if (cpu_mitigations_off()) - return; - - if (!boot_cpu_has(X86_FEATURE_CLEAR_CPU_BUF)) - goto out; - - /* - * X86_FEATURE_CLEAR_CPU_BUF is now enabled. Update MDS, TAA and MMIO - * Stale Data mitigation, if necessary. - */ - if (mds_mitigation =3D=3D MDS_MITIGATION_OFF && - boot_cpu_has_bug(X86_BUG_MDS)) { - mds_mitigation =3D MDS_MITIGATION_FULL; - mds_select_mitigation(); - } - if (taa_mitigation =3D=3D TAA_MITIGATION_OFF && - boot_cpu_has_bug(X86_BUG_TAA)) { - taa_mitigation =3D TAA_MITIGATION_VERW; - taa_select_mitigation(); - } - /* - * MMIO_MITIGATION_OFF is not checked here so that mmio_stale_data_clear - * gets updated correctly as per X86_FEATURE_CLEAR_CPU_BUF state. - */ - if (boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA)) { - mmio_mitigation =3D MMIO_MITIGATION_VERW; - mmio_select_mitigation(); - } - if (rfds_mitigation =3D=3D RFDS_MITIGATION_OFF && - boot_cpu_has_bug(X86_BUG_RFDS)) { - rfds_mitigation =3D RFDS_MITIGATION_VERW; - rfds_select_mitigation(); - } -out: - if (boot_cpu_has_bug(X86_BUG_MDS)) - pr_info("MDS: %s\n", mds_strings[mds_mitigation]); - if (boot_cpu_has_bug(X86_BUG_TAA)) - pr_info("TAA: %s\n", taa_strings[taa_mitigation]); - if (boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA)) - pr_info("MMIO Stale Data: %s\n", mmio_strings[mmio_mitigation]); - else if (boot_cpu_has_bug(X86_BUG_MMIO_UNKNOWN)) - pr_info("MMIO Stale Data: Unknown: No mitigations\n"); - if (boot_cpu_has_bug(X86_BUG_RFDS)) - pr_info("Register File Data Sampling: %s\n", rfds_strings[rfds_mitigatio= n]); -} - -static void __init md_clear_select_mitigation(void) -{ - - /* - * As these mitigations are inter-related and rely on VERW instruction - * to clear the microarchitural buffers, update and print their status - * after mitigation selection is done for each of these vulnerabilities. - */ - md_clear_update_mitigation(); -} - #undef pr_fmt #define pr_fmt(fmt) "SRBDS: " fmt =20 --=20 2.34.1