All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Babu Moger <babu.moger@amd.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	David.Kaplan@amd.com, Andrew Cooper <andrew.cooper3@citrix.com>,
	Nikolay Borisov <nik.borisov@suse.com>,
	gregkh@linuxfoundation.org, Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH v3 15/20] x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block
Date: Mon,  4 Sep 2023 22:04:59 -0700	[thread overview]
Message-ID: <0a22b86b1f6b07f9046a9ab763fc0e0d1b7a91d4.1693889988.git.jpoimboe@kernel.org> (raw)
In-Reply-To: <cover.1693889988.git.jpoimboe@kernel.org>

Simplify the code flow a bit by moving the retbleed IBPB check into the
existing 'has_microcode' block.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 arch/x86/kernel/cpu/bugs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 941ac94ad0d4..6b443f0fde34 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2430,10 +2430,8 @@ static void __init srso_select_mitigation(void)
 			setup_force_cpu_cap(X86_FEATURE_SRSO_NO);
 			return;
 		}
-	}
 
-	if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) {
-		if (has_microcode) {
+		if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) {
 			srso_mitigation = SRSO_MITIGATION_IBPB;
 			goto out;
 		}
-- 
2.41.0


  parent reply	other threads:[~2023-09-05 16:46 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05  5:04 [PATCH v3 00/20] SRSO fixes/cleanups Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 01/20] x86/srso: Fix srso_show_state() side effect Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:45   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 02/20] x86/srso: Set CPUID feature bits independently of bug or mitigation status Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:45   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 03/20] x86/srso: Don't probe microcode in a guest Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:45   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 04/20] x86/srso: Fix SBPB enablement for spec_rstack_overflow=off Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:45   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 05/20] x86/srso: Fix SBPB enablement for (possible) future fixed HW Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 06/20] x86/srso: Print actual mitigation if requested mitigation isn't possible Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 07/20] x86/srso: Print mitigation for retbleed IBPB case Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 08/20] x86/srso: Fix vulnerability reporting for missing microcode Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 09/20] x86/srso: Fix unret validation dependencies Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 10/20] x86/alternatives: Remove faulty optimization Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 11/20] x86/srso: Improve i-cache locality for alias mitigation Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 12/20] x86/srso: Unexport untraining functions Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 13/20] x86/srso: Remove 'pred_cmd' label Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` [PATCH v3 14/20] x86/bugs: Remove default case for fully switched enums Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:04 ` Josh Poimboeuf [this message]
2023-09-05 10:09   ` [tip: x86/bugs] x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:05 ` [PATCH v3 16/20] x86/srso: Disentangle rethunk-dependent options Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:05 ` [PATCH v3 17/20] x86/rethunk: Use SYM_CODE_START[_LOCAL]_NOALIGN macros Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:05 ` [PATCH v3 18/20] x86/retpoline: Remove .text..__x86.return_thunk section Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:05 ` [PATCH v3 19/20] x86/nospec: Refactor UNTRAIN_RET[_*] Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  5:05 ` [PATCH v3 20/20] x86/calldepth: Rename __x86_return_skl() to call_depth_return_thunk() Josh Poimboeuf
2023-09-05 10:09   ` [tip: x86/bugs] " tip-bot2 for Josh Poimboeuf
2023-09-19  9:53   ` tip-bot2 for Josh Poimboeuf
2023-09-23 12:20   ` tip-bot2 for Josh Poimboeuf
2023-10-20 11:37   ` tip-bot2 for Josh Poimboeuf
2023-09-05  6:35 ` [PATCH v3 00/20] SRSO fixes/cleanups Borislav Petkov
2023-09-05 10:02   ` Ingo Molnar

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=0a22b86b1f6b07f9046a9ab763fc0e0d1b7a91d4.1693889988.git.jpoimboe@kernel.org \
    --to=jpoimboe@kernel.org \
    --cc=David.Kaplan@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nik.borisov@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.