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 78833C83F3E for ; Tue, 5 Sep 2023 16:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234223AbjIEQqH (ORCPT ); Tue, 5 Sep 2023 12:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351027AbjIEFFU (ORCPT ); Tue, 5 Sep 2023 01:05:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C96AACC5 for ; Mon, 4 Sep 2023 22:05:17 -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 ams.source.kernel.org (Postfix) with ESMTPS id 727D9B810B6 for ; Tue, 5 Sep 2023 05:05:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFC01C43391; Tue, 5 Sep 2023 05:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693890316; bh=otPNzKDwP0knGMWa4St3Ci30JNUajDBlV4LBtFI0CEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PuXq148KCyVzDf8SM9fg4H8odnPAOkistj6TJ1qidIgoFkJhClxrgA/uV/WsCVC27 VgYgC73RIyS6UpgzhrkeV57Ms+Dn6PumZIZQd+tuZOTtY52tRmnD9uKGUEQV8hfJqc XuiIXFuh/i9/8Jpn75ym7FnuhYQk4tPHlG9uWAFxybFcA6xhM5C2Ly/2nyUpAYD4Nu C/E6m1A2x6nsDEzlZ9MjvYc7Vj6Mbvbp3z/zgwX3E3KAimwvVM13a3VKd9voe3oLJi aSZPFcklONm1OyVSdbo/7f1S5t1GlAnIdD1bGeGEHtCf06s15QXlu8uPIn1x1wC2Sm UnFFgL/gdL7ng== 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 15/20] x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block Date: Mon, 4 Sep 2023 22:04:59 -0700 Message-ID: <0a22b86b1f6b07f9046a9ab763fc0e0d1b7a91d4.1693889988.git.jpoimboe@kernel.org> 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 Simplify the code flow a bit by moving the retbleed IBPB check into the existing 'has_microcode' block. Signed-off-by: Josh Poimboeuf --- 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