From nobody Tue Oct 7 07:16:05 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 025452F3627; Fri, 11 Jul 2025 16:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752250186; cv=none; b=Z4/V0Q9qD26tecDcKZ0kW8MmLbgS0qe+BpzHW4Ep/zYUlrpytvd+1yo3BTj/g559iH7AUdUjFaIvDNwn/4hAuEtPlhSPM2lXW2JAKFypjq1EXu5Z1uWCJbhGM15FfQMQvwCf4BNVJUmwUrUcf5tMpfnM/hvCkuTR/Id7eC5o88A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752250186; c=relaxed/simple; bh=fmUTdfQ5ks7/ouyANCASsiXh3m3pGEtVE8lYujAyniU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=jg+st6IbmSSbu50WffWaghVxC4oupoDVTAXLevCT5D44humd0KrVkYRIRzpyg3BtQPKPAcy183047+9DUvXLFlrYQPF7b96VKStLTytnD5OIvjYke8Kxj9L6DaZuZ/e1qx6jq8EGaq/FsJsOL0RJ5SM4bGQoEFFHpjG3eNN3fTs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=359rzO3M; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=q4UANFd+; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="359rzO3M"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="q4UANFd+" Date: Fri, 11 Jul 2025 16:09:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752250183; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R0gfFV8VUvHWIf8etmTEb1j5rUTZSXC4SkB3a6iXZNQ=; b=359rzO3M1V5N7OX1FH4zpoTgTaaLh6uwtQRuOTCnDUs3HaqRFWg9LmGHGXjpljtEEYGkta PB4LX7JQlKQLR4KaJgUph1ZTB+CHerAiewFWIWThwssDqOvaKzV93Umeicml4t6hrfwN51 BInCoBnVHPb9l3ZEb6/y6pOvh6CHOD/Dm8osMepIPHytCnYFsQksumo/IpoVS63SOM1QFN fVD4lAOTLsu4jXImVBXarqAaHu96FV9WGg4KPZjbs0BhGoSNPCxTb270j4dOsm19m0B5sR I1dmR7Kr56Xf3yj/wNTmUJHRBKYZ4t7h4J6dxCsqLRMx4JSIfnth4/p7QAUddA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752250183; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R0gfFV8VUvHWIf8etmTEb1j5rUTZSXC4SkB3a6iXZNQ=; b=q4UANFd+AFL6VQPGFeC0YY50/VXKxkIoIlKVnJ6xB0m1Rvp/r0l1IqdiYN5QZ5ZJkkMhnA CbK8KtBPxJNubXCQ== From: "tip-bot2 for David Kaplan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/bugs] x86/bugs: Add attack vector controls for TAA Cc: David Kaplan , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250707183316.1349127-7-david.kaplan@amd.com> References: <20250707183316.1349127-7-david.kaplan@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175225018223.406.5657922974048706825.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/bugs branch of tip: Commit-ID: 736565d4edcd8b6dad50fca0c0134e7918e3d61c Gitweb: https://git.kernel.org/tip/736565d4edcd8b6dad50fca0c0134e791= 8e3d61c Author: David Kaplan AuthorDate: Mon, 07 Jul 2025 13:33:01 -05:00 Committer: Borislav Petkov (AMD) CommitterDate: Fri, 11 Jul 2025 17:56:40 +02:00 x86/bugs: Add attack vector controls for TAA Use attack vector controls to determine if TAA mitigation is required. Signed-off-by: David Kaplan Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/20250707183316.1349127-7-david.kaplan@amd.com --- arch/x86/kernel/cpu/bugs.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 31e0cf8..438c482 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -538,12 +538,13 @@ static void __init taa_select_mitigation(void) return; } =20 - if (cpu_mitigations_off()) - taa_mitigation =3D TAA_MITIGATION_OFF; - /* Microcode will be checked in taa_update_mitigation(). */ - if (taa_mitigation =3D=3D TAA_MITIGATION_AUTO) - taa_mitigation =3D TAA_MITIGATION_VERW; + if (taa_mitigation =3D=3D TAA_MITIGATION_AUTO) { + if (should_mitigate_vuln(X86_BUG_TAA)) + taa_mitigation =3D TAA_MITIGATION_VERW; + else + taa_mitigation =3D TAA_MITIGATION_OFF; + } =20 if (taa_mitigation !=3D TAA_MITIGATION_OFF) verw_clear_cpu_buf_mitigation_selected =3D true; @@ -551,7 +552,7 @@ static void __init taa_select_mitigation(void) =20 static void __init taa_update_mitigation(void) { - if (!taa_vulnerable() || cpu_mitigations_off()) + if (!taa_vulnerable()) return; =20 if (verw_clear_cpu_buf_mitigation_selected) @@ -592,7 +593,7 @@ static void __init taa_apply_mitigation(void) */ setup_force_cpu_cap(X86_FEATURE_CLEAR_CPU_BUF); =20 - if (taa_nosmt || cpu_mitigations_auto_nosmt()) + if (taa_nosmt || smt_mitigations =3D=3D SMT_MITIGATIONS_ON) cpu_smt_disable(false); } }