From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8965ECA0FF8 for ; Tue, 5 Sep 2023 16:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354854AbjIEQaN (ORCPT ); Tue, 5 Sep 2023 12:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350938AbjIEFFO (ORCPT ); Tue, 5 Sep 2023 01:05:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CB3CC5 for ; Mon, 4 Sep 2023 22:05:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9692D61341 for ; Tue, 5 Sep 2023 05:05:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A16FC433C7; Tue, 5 Sep 2023 05:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693890310; bh=uU+4b7Nqd1JBSc45+s2BfgDjWrwt8fgPRmfD9p0UXWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9NWdXYe47XNplgerj7RmG7ANgtcgkV+KKuSM1bntx4X6qtfZiwbxLTH8srAxIDpM Y6SbjnnEKSk75L3+FGSzCsjqtwL2m0kKj7mDz/uk3s4X7iFTkSDVDrP/C6d+FepxGu X8JS0nRvge33tDLjrJQiQ5W7XmR8e+3PGV3j37dVxoUxxBcrDc8VrlNVWs9Of6AzbH wMxm7za1GWz1Dls41opWcgw4E4itoipSmo+nGZRHlOh6GrovzhgjCYCP8bLJ4+65w7 NQsxRSjAdoXcYj6YA9mBDw7IZmWe1IbVyD6/dxoeMQxKPg9xo6bwS+rI+XsdWw515g EIRFGv8G1tcZQ== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Peter Zijlstra , Babu Moger , Paolo Bonzini , Sean Christopherson , David.Kaplan@amd.com, Andrew Cooper , Nikolay Borisov , gregkh@linuxfoundation.org, Thomas Gleixner Subject: [PATCH v3 05/20] x86/srso: Fix SBPB enablement for (possible) future fixed HW Date: Mon, 4 Sep 2023 22:04:49 -0700 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make the SBPB check more robust against the (possible) case where future HW has SRSO fixed but doesn't have the SRSO_NO bit set. Fixes: 1b5277c0ea0b ("x86/srso: Add SRSO_NO support") Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 10499bcd4e39..2859a54660a2 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2496,7 +2496,7 @@ static void __init srso_select_mitigation(void) pr_info("%s%s\n", srso_strings[srso_mitigation], (has_microcode ? "" : ", no microcode")); pred_cmd: - if ((boot_cpu_has(X86_FEATURE_SRSO_NO) || srso_cmd == SRSO_CMD_OFF) && + if ((!boot_cpu_has_bug(X86_BUG_SRSO) || srso_cmd == SRSO_CMD_OFF) && boot_cpu_has(X86_FEATURE_SBPB)) x86_pred_cmd = PRED_CMD_SBPB; } -- 2.41.0