Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp21727rdh; Mon, 21 Aug 2023 06:42:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXBAvzfV034MPbMKl9tqdaY9nNkba/px11KA53166xLqduILFcrIlBQU68wwjitdEBoo80 X-Received: by 2002:a05:6a20:7347:b0:145:47af:57d8 with SMTP id v7-20020a056a20734700b0014547af57d8mr8989772pzc.2.1692625331662; Mon, 21 Aug 2023 06:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692625331; cv=none; d=google.com; s=arc-20160816; b=mZqEy0gpK1wegcnsmykqbfKkseQEhgrIjVCt4hoVo5OKcE6TJG0IlhPZBTC/JsaBiv IRnzB1mxNmfBjfxe0o2Yr8hJeNj13nZlAqls82AgkJVMpBJ7LQRsxKiWd8VdtV3A0boZ yRpkwkIFRgcOGJaGGDY8yoeC76rDqqrIVV0iynPJRMZZnKuRzxjW73vp9jIOFLi2PRi5 XWf42habSsMr/Yw9AwKcQwkxqKihQ/FWax3wL7N6vISaSR6HPhnW8YHI4aPDYIfOQJZu 7b5v9FwM8LLPDNFdGol5VAu7XjYHhcZBaVH6c4XBKyw0WfH5DSFrmaawy1v6iBD8M1Wm 0P+w== 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=eXxLkEREKIIciizRc0xe2bswr2sIK4wGoXKgwgRqRak=; fh=1KVrD/LnRsN9N7k2d12iARV4DA2tVMW012QtKSrD46c=; b=D852sk9MI308MXotwPVEmCX3eTXxiVrg38rOMAy2LJlr8BB+v+ufVKhQIyE6XIkbtF Cb5owRTyVdE3uEcobB8lhdN4KZ2KPQoOlINQXEdXSpypetYB2u47q/0WQkIx4lZ4Pf+7 PDgjV4aWj/Ab5lluKduRu35RUg04GyN/rFNz7aImfe8XMxG6CDE58VMZZoWFqvRZxOcP u19MK3f8NAjpBNaFLF4KvF1D7tUjABhnNMMh9cCRd7Tn8JS7zvMzZANYpqU1HtuTrxcq 8whjrmqPfpm4OBNAgj68+Nww5sTB3g/uXlLtRQ0ZlGeqWyzk5JxLOP+u5c3aMxKoo/47 CU0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UNSLVO+x; 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 bi30-20020a056a00311e00b00665c24182bcsi6621577pfb.219.2023.08.21.06.41.59; Mon, 21 Aug 2023 06:42: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=UNSLVO+x; 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 S232383AbjHUBTv (ORCPT + 99 others); Sun, 20 Aug 2023 21:19:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232302AbjHUBTg (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 21741A3 for ; Sun, 20 Aug 2023 18:19:35 -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 5E1996262F for ; Mon, 21 Aug 2023 01:19:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CF0EC433C7; 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=1692580773; bh=EpkqZFYNSyZGV6nHO1Oxkdk31qPtS0UZWhnMgeIshmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UNSLVO+xGzJj5z8TBvOnbkzLRAMDktwW0uiqRJk9thQ66Jp94Rxj+8+sixXrk91Sd hOSDngcwsz2qZqilN/1LVTOb/8pAQrde6MUx4/VCg/dhbnxGNwpmQuxp2I96PsD0sH tkWdQHEzYrz0ksUmegxHV9/xpT2KcpKB1FrwAe1HmlwiFEBmk0DM0Ms0oEHFcEq3NB 2vHxly6VIaIou6QKCkfldr4VmbFRtRW3bNGFINpUw6dUmZSO0n8tS0wcGrhvvVbRzf Y0nh7RlNCzqnqhaRLhwYSGEPrVcgrC2c/TuvzhSVPo3HSsgq7e36VskWuPLASDQ3X5 bWRUhXtHbG6EA== 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 11/22] x86/srso: Slight simplification Date: Sun, 20 Aug 2023 18:19:08 -0700 Message-ID: <18b18b8709b72625b60156545a705b052646667c.1692580085.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=-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 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 4e332707a343..b27aeb86ed7a 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2421,10 +2421,8 @@ static void __init srso_select_mitigation(void) setup_force_cpu_cap(X86_FEATURE_SRSO_NO); goto out; } - } - if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) { - if (has_microcode) { + if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) { pr_info("Retbleed IBPB mitigation enabled, using same for SRSO\n"); srso_mitigation = SRSO_MITIGATION_IBPB; goto out_print; -- 2.41.0