From nobody Fri Dec 19 19:04:55 2025 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2081.outbound.protection.outlook.com [40.107.236.81]) (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 F300D2054F9 for ; Wed, 8 Jan 2025 20:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736367955; cv=fail; b=uUVjimui6rw3sJelVOcB903KSQeWhTfWUwU9GFyLXXsYJJcDOj45ScsrokMI9J5iqvNKQo+ffVaVyl01//FPQTaQ+y0z2jTEaGhjReSpFG/kIkz6pZsQtAsoy87wEDD0qjlgfRwPh8blKHooTEj46DaXo/zYAc/fSRtLAbhM8Js= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736367955; c=relaxed/simple; bh=cnrtMCI+1qqKwatptiwy7BmeRJ03iH3EdfMKJ0J3Dmo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ugtrE2vmcbb+XR4aM3hcc1zg5LICdNjYACwBDBhig2xroUiEIbEUoRc9tUyBIk6jmAK43YlRWHVFOX3er4Xt3rd8x7eKD2lVjtT7ht7bTGlXhJiYdyGN4dFvdUhlhuECE7HoMlOxEKOvbEe2SdAR6cWBxC1LfvQVyM8cuNY0EHQ= 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=NrcV8I9c; arc=fail smtp.client-ip=40.107.236.81 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="NrcV8I9c" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uUXA55ymFLQVVeO+hGmWX11J0ksp1ZbreYde5+Vo+bkK/wXRwF/WpXw/FXLrKe5892kSXRVGv7ZyU94qNM4A0UlDR/ZeGc4g4zuLCqpIioBjuZba6XHGfKML7NHq6Ey/aEDOE7jeiM3+gy8ZrMwQdNuYOicnMrquca5oR6tTVenP3DdDzVMCVicf50Ch2kZj21NrlkVksAIDQoXwj5FpiiCL8Ea8gGqobqdztVI+4DXlFHuGHm10UsRISZbAasC/k4ojJYqx8+czN7sSkMMfORSaMjithRg1b1TEu+1nBp24OPwzm0AUIrQ+/jogxP7nGeTf3VXxZXRCA30ZGJ/jbQ== 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=UI2TcdsZ+0QzD6Iftw9Wzf/KKoqYTwP9jds0wwVqR1I=; b=Y6XI26ngAOBGbr5YW4i5eEtUUuKdfbwwrAGTYAkmsXPDELPo/rr34TuQsk5l6DV3U3AxOMYot0AbGhalms35rvPBqo9Z1NsozD8ainUJBeJEk87/i/6XzetAnZqgJz66VG75iAj+4T/bqqs0zQmpZ2b84DQ+SV22xekLAnHFAha6pow3fguPMcZE9q1CgCr0+UIcK6qiCORBbgytdh9BDUuSG7yKTVgmUqa0+Esok0y2nrKzcs1tozBk0Uw1Dub5o+2EGYOhk/uxqnp4y4xHfyDhKFNnxRZtUoxmqJexlRtb0gXkoN/O11sPxup3nJvLAWcNIW7fkloCZzgo4ZIaUQ== 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=UI2TcdsZ+0QzD6Iftw9Wzf/KKoqYTwP9jds0wwVqR1I=; b=NrcV8I9cDGrUzbiU9HBdPuQ/MdW/yKuBYgfqTBw2lqje/SC5g+VIVE4tBUh89Rwqfv5rV65S1YrQiSPTVvi9kXcIIbNi1Jio2sqstJ80fYZV3kR8SuFVUKYAq+uX1kSSzircnKTWEp/T9ypaEN81IP9o1/UEFv1IspE0ofrc/dI= Received: from SA9PR11CA0003.namprd11.prod.outlook.com (2603:10b6:806:6e::8) by BL1PR12MB5876.namprd12.prod.outlook.com (2603:10b6:208:398::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.10; Wed, 8 Jan 2025 20:25:51 +0000 Received: from DS3PEPF000099E2.namprd04.prod.outlook.com (2603:10b6:806:6e:cafe::62) by SA9PR11CA0003.outlook.office365.com (2603:10b6:806:6e::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8335.11 via Frontend Transport; Wed, 8 Jan 2025 20:25:50 +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:50 +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:49 -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 25/35] x86/bugs: Add attack vector controls for rfds Date: Wed, 8 Jan 2025 14:25:05 -0600 Message-ID: <20250108202515.385902-26-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_|BL1PR12MB5876:EE_ X-MS-Office365-Filtering-Correlation-Id: a4f39162-982e-4e4c-e342-08dd3022a496 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?3ufOkmP0qnGpzLDSMoQwpMRx6R7rn5lhe3N2UtFexv6PBnxcn7pF9eoq7VmM?= =?us-ascii?Q?tBZlzscUrcoSWt6wQ0okuSAx+PwwNwMYHNsHh9ySb9qTUYlDDbEerJqvPmPn?= =?us-ascii?Q?LMS4ywq20waTlp9NWoU0I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4R8Kduaj1RIPv8Ny1cKr2koDWRFHJ/6XYiBiwoJU2iEa7N5PetnhbtsBK6UQ?= =?us-ascii?Q?BreTNoW8yeF/10bpamuWx2MCjFMUl9yMjotzFY5tsqYIIchjfQBtycUqnkch?= =?us-ascii?Q?z3HxxbIo1pXpzP6pbZqUXM25Q5Ye0dXwq6I9bF0ddG1lBbJfYLptytUlRES2?= =?us-ascii?Q?qlg97i0Y/F/QYupYSQyu8m1Dxlk8+1aOonjrYeuNWMJaj10eopEOMic/qu9j?= =?us-ascii?Q?owQuUMCwg+fN4M+9f9pHyPPr6lYjLccR8k1Kso91Z0pJxk57llv5wNTUGMxt?= =?us-ascii?Q?f0mqpbyJCOeOa2SyD4BNB3q1ilWsV8QbRkO4L1/fk8hhhFpdG7UhUmPQGgwC?= =?us-ascii?Q?MpfV1e2n9kcEbCr9Lva8mxxC6Lkx94bNFJOeImm41IrwWpt3MQHW1qoKiero?= =?us-ascii?Q?86TKv/gQNdUViJPEvqe9uZ3+aeYuPUgKGz+jFZyFCpaeEY5jJY4vkCG+cuJa?= =?us-ascii?Q?zQpDt6bE896aAF8=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)(82310400026)(1800799024)(376014)(36860700013)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2025 20:25:50.3758 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4f39162-982e-4e4c-e342-08dd3022a496 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: BL1PR12MB5876 Content-Type: text/plain; charset="utf-8" Use attack vector controls to determine if rfds mitigation is required. Signed-off-by: David Kaplan --- arch/x86/kernel/cpu/bugs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 4249a1f1524c..d9b12c706fc0 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -783,8 +783,12 @@ static void __init rfds_select_mitigation(void) if (rfds_mitigation =3D=3D RFDS_MITIGATION_OFF) return; =20 - if (rfds_mitigation =3D=3D RFDS_MITIGATION_AUTO) - rfds_mitigation =3D RFDS_MITIGATION_VERW; + if (rfds_mitigation =3D=3D RFDS_MITIGATION_AUTO) { + if (should_mitigate_vuln(X86_BUG_RFDS)) + rfds_mitigation =3D RFDS_MITIGATION_VERW; + else + rfds_mitigation =3D RFDS_MITIGATION_OFF; + } } =20 static void __init rfds_update_mitigation(void) --=20 2.34.1