From nobody Wed Oct 8 15:58:29 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 C4CBB26B76D; Thu, 26 Jun 2025 09:10:02 +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=1750929004; cv=none; b=La8gd4YT+qPpUPvaj17fg2LEISfTn6R37YhlfNOJmb7JFX7Po8+7Hp9StSXMNCLykK5OEqDcP14CkYXRtpoZbK2eFr8ZxmEJRMLR4uT39QiOm8tTqq028aHidB/3GwuYZpyT902Afhucig85bjGIjhGaokrUTOvqRv7EEjuTdIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750929004; c=relaxed/simple; bh=Ajynqem2ioOKzb1RG7SUqhKZOJKIsxfiL6AdqHeyrHc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Rz8rxzAMCrUiQE7YMU1b5eg8ijqnVBHQ95Fu+dXcAoFaZ5hO7aeb9vqEgrzseCtF8vR6TsMFeGNmw5MyIdj4aGkbU7zh1YhrSIErWhmGw02DrzVwq7elinOcq95xQEE3HHQyG+np4EsD07CB+Zpe1VqAVyc3yrgh+NwYAlWUK0w= 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=CVOXDOoZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VsiOhG/1; 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="CVOXDOoZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VsiOhG/1" Date: Thu, 26 Jun 2025 09:10:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1750929001; 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=pLyGErgkP7aeo4xKyl4kAAV+J4OKXallBd0v3+MhuK8=; b=CVOXDOoZNdEB9QBksGFxwQP89nrAWyOnQFn+rpsaOLr3qb7tyNqdm/KJuYDFg6AdOY/oYY LSJSLRDQ5xopRwcSgBVntUNnSWdChPiSngSRsdgZoIXLnKPbgNax3mdTgF7fs1dx+u79pI JFTHAUJbxOl8jkrnnpOFcq+3l45rXb4hJ5aMaBGjNQEvZwZ+j8y+2WLGmAYJCjw/5wOCf/ Enw49wqshhCuGhu+TLi1FROHJj97oBTMIkdbrWNvD4mmrT696dLGvkhYs9cq/WEka7wWrg wYtaQ9yeLjOWlCFx8qGMoilXIlRik4vwix+4l/MqUDV9Bgj/BUeldFZgWb4qtA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1750929001; 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=pLyGErgkP7aeo4xKyl4kAAV+J4OKXallBd0v3+MhuK8=; b=VsiOhG/1mh7EosZuO1VFoEfzzsAiVN6g7Qoz3Z168rTX/XOLrgbJJey8r6jftPOMRZ28iO +e5Sfv+sBpKk33DA== 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 SRSO_MITIGATION_NOSMT Cc: David Kaplan , Ingo Molnar , "Borislav Petkov (AMD)" , "H . Peter Anvin" , Dave Hansen , Josh Poimboeuf , Pawan Gupta , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250625155805.600376-2-david.kaplan@amd.com> References: <20250625155805.600376-2-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: <175092900020.406.6486511755076508456.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: 1fd5eb02867ac7db9144bd44c8edfad0189c8e57 Gitweb: https://git.kernel.org/tip/1fd5eb02867ac7db9144bd44c8edfad01= 89c8e57 Author: David Kaplan AuthorDate: Wed, 25 Jun 2025 10:58:03 -05:00 Committer: Ingo Molnar CommitterDate: Thu, 26 Jun 2025 10:56:39 +02:00 x86/bugs: Add SRSO_MITIGATION_NOSMT AMD Zen1 and Zen2 CPUs with SMT disabled are not vulnerable to SRSO. Instead of overloading the X86_FEATURE_SRSO_NO bit to indicate this, define a separate mitigation to make the code cleaner. Signed-off-by: David Kaplan Signed-off-by: Ingo Molnar Reviewed-by: Borislav Petkov (AMD) Cc: H . Peter Anvin Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Pawan Gupta Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20250625155805.600376-2-david.kaplan@amd.com --- arch/x86/kernel/cpu/bugs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index bdef2c9..6c991af 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2851,6 +2851,7 @@ enum srso_mitigation { SRSO_MITIGATION_UCODE_NEEDED, SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED, SRSO_MITIGATION_MICROCODE, + SRSO_MITIGATION_NOSMT, SRSO_MITIGATION_SAFE_RET, SRSO_MITIGATION_IBPB, SRSO_MITIGATION_IBPB_ON_VMEXIT, @@ -2862,6 +2863,7 @@ static const char * const srso_strings[] =3D { [SRSO_MITIGATION_UCODE_NEEDED] =3D "Vulnerable: No microcode", [SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED] =3D "Vulnerable: Safe RET, no mic= rocode", [SRSO_MITIGATION_MICROCODE] =3D "Vulnerable: Microcode, no safe RET", + [SRSO_MITIGATION_NOSMT] =3D "Mitigation: SMT disabled", [SRSO_MITIGATION_SAFE_RET] =3D "Mitigation: Safe RET", [SRSO_MITIGATION_IBPB] =3D "Mitigation: IBPB", [SRSO_MITIGATION_IBPB_ON_VMEXIT] =3D "Mitigation: IBPB on VMEXIT only", @@ -2914,8 +2916,7 @@ static void __init srso_select_mitigation(void) * IBPB microcode has been applied. */ if (boot_cpu_data.x86 < 0x19 && !cpu_smt_possible()) { - setup_force_cpu_cap(X86_FEATURE_SRSO_NO); - srso_mitigation =3D SRSO_MITIGATION_NONE; + srso_mitigation =3D SRSO_MITIGATION_NOSMT; return; } } else { @@ -2968,8 +2969,7 @@ static void __init srso_update_mitigation(void) srso_mitigation =3D SRSO_MITIGATION_IBPB; =20 if (boot_cpu_has_bug(X86_BUG_SRSO) && - !cpu_mitigations_off() && - !boot_cpu_has(X86_FEATURE_SRSO_NO)) + !cpu_mitigations_off()) pr_info("%s\n", srso_strings[srso_mitigation]); } =20 @@ -3265,9 +3265,6 @@ static ssize_t retbleed_show_state(char *buf) =20 static ssize_t srso_show_state(char *buf) { - if (boot_cpu_has(X86_FEATURE_SRSO_NO)) - return sysfs_emit(buf, "Mitigation: SMT disabled\n"); - return sysfs_emit(buf, "%s\n", srso_strings[srso_mitigation]); }