Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1113741rdb; Sun, 20 Aug 2023 18:31:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzYjaYgD8e6ucwBZmPih9aSsRdoQB6uaMTiV+jK6myH6R5E1tfu6O2JjbFT+zfK9GCLte8 X-Received: by 2002:a17:907:16ac:b0:992:13c7:560 with SMTP id hc44-20020a17090716ac00b0099213c70560mr4877797ejc.38.1692581481705; Sun, 20 Aug 2023 18:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692581481; cv=none; d=google.com; s=arc-20160816; b=EdlyuKcTVUDQalbXcfB3ikoH0cFRTLKRitK4pzUinSk4LnwY9snvNcKWc0i45QHR9N OrF76JNev0tU5eKnXezvAYSJ/eqVboGlF3qhPGHqON9qunRpvaWlP/zElNS3lYyckxBb WBPsClmTlU2SUZsyP7ppKxZf1pbh/uKpSbmCFaNTjD/aAoJJWHkxs/LoY1O5C8L7wZeh ymxihOUgCWVVTZ/Ej5BeGva3A18XMdJdCktE5BeT7wG7s2EKxDPKvgdpAJyTMlfse8TE mWw1G4fODrU/SCAWBQvGyd6jB1aKkSh2uSXALtVS3vSY+yg85wCMGhs/6NCo0BPo+MMu cx5Q== 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=nk+u/Lcn54RzFEP0LBJp0QdU3sgUiVph5fmEyJ3Efus=; fh=1KVrD/LnRsN9N7k2d12iARV4DA2tVMW012QtKSrD46c=; b=P0rumt6fr2LqEH85wdVdspK8XJ6YdDPL+2/AbpUpFpe57t72iPfwwQh0VPqtVwh9ao bbIlcLq2VRRnHbfsJXtallyYcXMS3sm7TK1vz6nT2YYY3y0DVFzAjXAvOIHBfQX3KSS7 Z8e/v1LBqyUq+RCqusKlt1V0V0v7EJ55fMlwVkRbK2kqUnuLi7XFOCcIrAuboxCDYV1+ +Yqh9zROLJPgndz95O7IUG9SBiQqvnnb0Q6zN4QwZ6+ayZ/vNCTQER6vmaurTpiTGw5W 20DDU4xwphrgaHM1RMsTLjoK9Z/TSlt87FvoDOT9pC58caGlfBSrOWEQglldGMUujBqn He3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MaW4jMTE; 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 uz12-20020a170907118c00b00992a0f83dfcsi5221555ejb.471.2023.08.20.18.30.57; Sun, 20 Aug 2023 18:31:21 -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=MaW4jMTE; 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 S232365AbjHUBTt (ORCPT + 99 others); Sun, 20 Aug 2023 21:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbjHUBTg (ORCPT ); Sun, 20 Aug 2023 21:19:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A17B99C for ; Sun, 20 Aug 2023 18:19:34 -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 8182B6263B for ; Mon, 21 Aug 2023 01:19:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCD81C433C9; Mon, 21 Aug 2023 01:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692580774; bh=+kH/vW1/0PRsTr3iUIGO8h94X0Xqn63vyQGLo/1oKrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MaW4jMTE1TxgyOxgMgG/ogBAE0BrWr62wcLtNyv7r9dPJQ7Xa7riO00u1LJ+g/Vio ycBm0dQ657gT18X/tBSbqcdWWmIUrXSsZTTYDeHDxgkdAQ8WqiiM+djSb9sc78LA8E +xhxVIuZ2NDO3YFlVFDV16ZJKtVrJunznSkTEneQmN++NSvU6SLKhb3h+MLwGff8/2 PHK6F+0kMSJsIJwRGKFQpZxcJAv8fPR8ahHdx8THq+NOL5TR0wGSYMmYbSD5pThRph n8S0FIYNQaM1v6FaME8qKcpmIsLhIOdpZqmVoc6yNmvbTie7LZbvM1vga9bY/rKf/Y MUmMpgZNKT84Q== 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 12/22] x86/srso: Remove redundant X86_FEATURE_ENTRY_IBPB check Date: Sun, 20 Aug 2023 18:19:09 -0700 Message-ID: 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=-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: 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 b27aeb86ed7a..aeddd5ce9f34 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2475,7 +2475,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