[v3,15/20] x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block
Message ID | 0a22b86b1f6b07f9046a9ab763fc0e0d1b7a91d4.1693889988.git.jpoimboe@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1815607vqo; Tue, 5 Sep 2023 10:09:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNmlxLMiHA3zTJFnBqwel8Wjy3mSKw6oCTQkPAbnoZNAVb9eJlL/T0ggBbnwMsGLywIJNr X-Received: by 2002:a05:6a20:f398:b0:14c:d0d2:326d with SMTP id qr24-20020a056a20f39800b0014cd0d2326dmr13439680pzb.61.1693933768144; Tue, 05 Sep 2023 10:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693933768; cv=none; d=google.com; s=arc-20160816; b=GLBZhq+c5zi8kBM3FLz9h/yPyy5yGb2CQIS2SO4WfPYPvZh2gw+lEg+uUHgRw4qC0a ex6URxcyEttImTzLhNLpvocv84dnEkjLU4Z28lf1WaK44BbfvZQ/daPSjE/QPpvN+Czk 6IusJsl8EZF9IPRvuHuw0MLXWDs9fFkqaCR/OG/6jIVU56WhzJ8uG9iwRAlUhrnhZasx fqbaxCp3DipnTcmofAePwTJyn343Y5dMgF2/cWQ8uYy+29W7M5FST+6YW7YZdVmSOv4H h+LEheEasX1E1CBaplYuH8mWm2Iqd4q9l4SSgTZlUNbFeuRfwbhiSDSnKvVCORN8KrjY s/tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nOlDgec0voLG+8RiSsk6RELEjk3dCNIvHJUJjKS+9/0=; fh=ZwaEcDYNCnlh+U7YxZ1LCEcet9pcdhSkEX0cCEOksvY=; b=WDDfEqBwGHrsedUgQAshcaDMJL8nDiH8GB2UZDI1UWv5BFgk2keKR21qvCjTWzsm6S eVn5JwiDgIvx4aAE1njxqYcz8uGwdPzfl9g+evr41AhPH0rYEgT0g89Hde/9Q1HteK79 SABKlw7kbTk9U89bgxYAHNlPgBWZ5DhNcMf6hTB5jbbuZVwvgjL8DLynkp+oUx6lltf/ 8aLlItYcnhfXX/XPKBbDW5AoiYx9t964CAiYdW5TNcBQnMMOoWM9+G+y+nYBHmZwrU6Y 861HPsnBFR5EZt9D11gyMoGr7Hy8becPA93YdR7S21BbUgiUJNPBboRv9lgTTjMZMvZt k+lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PuXq148K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y38-20020a631826000000b00533fce755adsi9678015pgl.130.2023.09.05.10.09.21; Tue, 05 Sep 2023 10:09:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PuXq148K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233068AbjIEQqE (ORCPT <rfc822;ouuuleilei@gmail.com> + 38 others); Tue, 5 Sep 2023 12:46:04 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <linux-kernel@vger.kernel.org>; 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 <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 Message-ID: <0a22b86b1f6b07f9046a9ab763fc0e0d1b7a91d4.1693889988.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <cover.1693889988.git.jpoimboe@kernel.org> References: <cover.1693889988.git.jpoimboe@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776218294438773999 X-GMAIL-MSGID: 1776218294438773999 |
Series |
None
|
|
Commit Message
Josh Poimboeuf
Sept. 5, 2023, 5:04 a.m. UTC
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; }