patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, "Borislav Petkov (AMD)" <bp@alien8.de>
Subject: [PATCH 6.1 12/15] x86/srso: Disable the mitigation on unaffected configurations
Date: Thu, 24 Aug 2023 16:15:08 +0200	[thread overview]
Message-ID: <20230824141447.741853591@linuxfoundation.org> (raw)
In-Reply-To: <20230824141447.155846739@linuxfoundation.org>

From: Borislav Petkov (AMD) <bp@alien8.de>

commit e9fbc47b818b964ddff5df5b2d5c0f5f32f4a147 upstream.

Skip the srso cmd line parsing which is not needed on Zen1/2 with SMT
disabled and with the proper microcode applied (latter should be the
case anyway) as those are not affected.

Fixes: 5a15d8348881 ("x86/srso: Tie SBPB bit setting to microcode patch detection")
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230813104517.3346-1-bp@alien8.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/cpu/bugs.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2399,8 +2399,10 @@ static void __init srso_select_mitigatio
 		 * IBPB microcode has been applied.
 		 */
 		if ((boot_cpu_data.x86 < 0x19) &&
-		    (!cpu_smt_possible() || (cpu_smt_control == CPU_SMT_DISABLED)))
+		    (!cpu_smt_possible() || (cpu_smt_control == CPU_SMT_DISABLED))) {
 			setup_force_cpu_cap(X86_FEATURE_SRSO_NO);
+			return;
+		}
 	}
 
 	if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) {
@@ -2686,6 +2688,9 @@ static ssize_t gds_show_state(char *buf)
 
 static ssize_t srso_show_state(char *buf)
 {
+	if (boot_cpu_has(X86_FEATURE_SRSO_NO))
+		return sysfs_emit(buf, "Not affected\n");
+
 	return sysfs_emit(buf, "%s%s\n",
 			  srso_strings[srso_mitigation],
 			  (cpu_has_ibpb_brtype_microcode() ? "" : ", no microcode"));



  parent reply	other threads:[~2023-08-24 14:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 14:14 [PATCH 6.1 00/15] 6.1.48-rc1 review Greg Kroah-Hartman
2023-08-24 14:14 ` [PATCH 6.1 01/15] x86/cpu: Fix __x86_return_thunk symbol type Greg Kroah-Hartman
2023-08-24 14:14 ` [PATCH 6.1 02/15] x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk() Greg Kroah-Hartman
2023-08-24 14:14 ` [PATCH 6.1 03/15] x86/alternative: Make custom return thunk unconditional Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 04/15] x86/cpu: Clean up SRSO return thunk mess Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 05/15] x86/cpu: Rename original retbleed methods Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 06/15] x86/cpu: Rename srso_(.*)_alias to srso_alias_\1 Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 07/15] x86/cpu: Cleanup the untrain mess Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 08/15] x86/srso: Explain the untraining sequences a bit more Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 09/15] x86/static_call: Fix __static_call_fixup() Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 10/15] x86/retpoline: Dont clobber RFLAGS during srso_safe_ret() Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 11/15] x86/CPU/AMD: Fix the DIV(0) initial fix attempt Greg Kroah-Hartman
2023-08-24 14:15 ` Greg Kroah-Hartman [this message]
2023-08-24 14:15 ` [PATCH 6.1 13/15] x86/retpoline,kprobes: Fix position of thunk sections with CONFIG_LTO_CLANG Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 14/15] objtool/x86: Fixup frame-pointer vs rethunk Greg Kroah-Hartman
2023-08-24 14:15 ` [PATCH 6.1 15/15] x86/srso: Correct the mitigation status when SMT is disabled Greg Kroah-Hartman
2023-08-24 21:31 ` [PATCH 6.1 00/15] 6.1.48-rc1 review Florian Fainelli
2023-08-25  3:05   ` Florian Fainelli
2023-08-25  1:30 ` SeongJae Park
2023-08-25  2:40 ` Joel Fernandes
2023-08-25  7:05 ` Naresh Kamboju
2023-08-25  7:15   ` Harshit Mogalapalli
2023-08-25  7:45   ` Christian Brauner
2023-08-25  8:10   ` Greg Kroah-Hartman
2023-08-25  8:48     ` Naresh Kamboju
2023-08-25 16:29       ` Harshit Mogalapalli
2023-08-25  9:33     ` Naresh Kamboju
2023-08-25  9:26 ` Sudip Mukherjee (Codethink)
2023-08-26  8:45   ` Salvatore Bonaccorso
2023-08-25  9:40 ` Naresh Kamboju
2023-08-25 10:15 ` Jon Hunter
2023-08-25 12:16 ` Conor Dooley
2023-08-25 12:33 ` Takeshi Ogasawara
2023-08-25 15:40 ` Guenter Roeck
2023-08-25 18:12 ` Shuah Khan
2023-08-26  1:23 ` Bagas Sanjaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230824141447.741853591@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bp@alien8.de \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).