Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp814373rdb; Fri, 25 Aug 2023 01:41:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZoOywgJ6tHsu8b56Ym40zLavOhOeMvAcvJvJzNdaAu1u7wS5XZ9LwTyeUMBSyPk5BPoYI X-Received: by 2002:a05:6a20:9381:b0:12d:10b6:98f9 with SMTP id x1-20020a056a20938100b0012d10b698f9mr23152073pzh.56.1692952871348; Fri, 25 Aug 2023 01:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692952871; cv=none; d=google.com; s=arc-20160816; b=OP295N7wpbzzgbMO7sL1ShUMMjCYtGMHd5Lie8ri9E8krjV6aF0uSUbcxrBEv0fag9 CkII40e1WQaufpTb1PsGfVFhnVWDRlbKECWT6912k2IAGaMVnlf0NwKsdTYVFzk2Rdsj SOv9owm/xhviD1qnqbGn0YrI2og7cZ35P8JVk4UPkLZOTcXYmmR7f5C9uFbiQxMLZ+Xg 8kMFUDOAo0mc6nVFFkQ38/zQCspTopyNQYHsT9tlmWyW5FgXFQaS1PBXcCnFYkcSEJxz XH6eCSOPxdlprYc7tpzX2sc35eOI2CNcDoa8jQFK6bijRgITmRkHKnmQ9Q9l2ncQc/g+ gkBA== 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=aR26Q/VMi70D3ajbx5eUPex3tkkMOC9/WdwBn+x3QeY=; fh=ZwaEcDYNCnlh+U7YxZ1LCEcet9pcdhSkEX0cCEOksvY=; b=EH0W3RYbOsE9mRG5IXgilXNYEPRduOvRdGSvR/B+alfDIun+fG+7nZHd8e3HnHabox JFVNcEApQ0OHpBNv3X2YtxPA3OGcZNReo1OBgg9rJjI1E1kJe7JJyfTJP84EiJOwYDxm LxGas8Xy9WJiHqOM/bELUfq0Ed/Gg4AiFeCFO5faiFrKmNya2Da10ppYEHEAh8htXfi1 W/DSWsNrDhkXfQcu5dm37Zm9BNiqjJhq/4k0zEE20i89YTEq5s0aBw3esrEmATM5iWlv klcCzt1JIU9VbI0lTZPCBNNFGrJVfKEmqwYSUWBA5Mc8VJmDLmwG34z2QMnmfPy5/7Zn 5e3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u8L+xkJx; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn15-20020a056a00340f00b0068bc5ff13cdsi1344865pfb.354.2023.08.25.01.40.55; Fri, 25 Aug 2023 01:41:11 -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=u8L+xkJx; 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 S243079AbjHYHDT (ORCPT + 99 others); Fri, 25 Aug 2023 03:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242712AbjHYHCP (ORCPT ); Fri, 25 Aug 2023 03:02:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6DE0199E for ; Fri, 25 Aug 2023 00:02:13 -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 65BF0666F8 for ; Fri, 25 Aug 2023 07:02:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66A2BC433CB; Fri, 25 Aug 2023 07:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692946932; bh=1jMNU8kkyCvXNPKUDKEGQ9C2EpveOGmoBxllKHP+AdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u8L+xkJxVgmcms5VpI5x2bGJIR/9Pud7uTbxIsKECyP0ngHUJrdxhU+b5Onngva5K d1lUbvKlzn3JY8vDAj/bOI1uj+vygB5zmlVcb1rduJdqVILoGU1v6yo/x/JfXK4ojo lyzU4gQCEGas+Wuk5fuoHKFVlqBmu3kSYSK0D0xt/yVe7rCxZTqUU4SwXa6sI55LsB 4b2RBqB96fffqWCEwqBlbGqDZUAQnxaEQ1vjDE9Dv2MShDSBR4k9yrOBGxPkke0OeV C7wAaYavfvMoFJOoYmW1rQLHPFQAzCts6lJUcYJfcHZBydPkOj2260vgyjh2sDReOH r4iaolVVRTHSA== 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 18/23] x86/srso: Remove redundant X86_FEATURE_ENTRY_IBPB check Date: Fri, 25 Aug 2023 00:01:49 -0700 Message-ID: <9b671422643939792afe05c625e93ef40d9b57b5.1692919072.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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: X-Mailing-List: linux-kernel@vger.kernel.org The X86_FEATURE_ENTRY_IBPB check is redundant here due to the above RETBLEED_MITIGATION_IBPB check. RETBLEED_MITIGATION_IBPB already implies X86_FEATURE_ENTRY_IBPB. So if we got here and 'has_microcode' is true, it means X86_FEATURE_ENTRY_IBPB is not set. 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 b086fd46fa1b..563f09ba6446 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2494,7 +2494,7 @@ static void __init srso_select_mitigation(void) case SRSO_CMD_IBPB_ON_VMEXIT: if (IS_ENABLED(CONFIG_CPU_SRSO)) { - if (!boot_cpu_has(X86_FEATURE_ENTRY_IBPB) && has_microcode) { + if (has_microcode) { setup_force_cpu_cap(X86_FEATURE_IBPB_ON_VMEXIT); srso_mitigation = SRSO_MITIGATION_IBPB_ON_VMEXIT; } -- 2.41.0