Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp814519rdb; Fri, 25 Aug 2023 01:41:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEK3DOLCCNGDdvV6dQbdKjMIr2+KN8g/jUBN64dcUFGb+Awr71SmoftUoEGqDBWvFvKsm8G X-Received: by 2002:a05:6902:2:b0:d47:d267:26fe with SMTP id l2-20020a056902000200b00d47d26726femr17033895ybh.21.1692952893099; Fri, 25 Aug 2023 01:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692952893; cv=none; d=google.com; s=arc-20160816; b=wsHo4CCbBOSpifaPWG4AH++NbJMeD7s+Psc9YAcZA3IZbQ11kM4d4OoNUeceTO1iC2 R6XVX1SKkH9CY+tEYK3oBDXNlrX1h/GTkyW1LxxVnWbB3X/UI1jG47lWMhRoAbrMVblk AehUgC0cc2iIZTx0pZ9V6Yx2Dbs+OED6PZm/6YDVk/7OTnliCHVvPf3zRojv+Rp3HhYb TLJ4LRp1dr4AoVlyXNTBYWknKDhT7TSlaE5dW3EVGwsQFYHzrrvroCOZAkO1LHNBLRYz CjDF46L5CJwwjM57jwIiZeJ9LG64NfTZQp+HOonxTkWBvHmAO30cov7G54ltjqK3F77O QFIA== 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=J+R0uURjiOFCZmPv8QQBytUqQoLa/0f/DBO+X8kwtBg=; fh=ZwaEcDYNCnlh+U7YxZ1LCEcet9pcdhSkEX0cCEOksvY=; b=gv2wnlBu9FmiZa0ybSyp1waHNWORe9NLapogXq2kSM9ATbX9ZdkIHvDT5KkFcW3YEa NpD9DSXaPLElV3OYLJ3golHcDpfTFws1SGMFJn/dvl43NZCS9RH0ejzLyNFLV+E7/IYv 6HUu3w5SJQW/JAWmvzIiEnJrPZSt+EdOP6OwpO+/Up3VPe733UJ0FvicZ7e3RiJ2XnZJ 6HNdDoOo3cqXKkxzLYpyedDJXPI+bOITmQhTgEki8tLAtmLseyBPMskk5XYcxDOCP5tl jCdBifN1fKQtJXzq8QvsrOaOSNleVpgREFzBuJ2EHwxhrq+crWh+69WfH/kkDt32DLbW /WVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dkPreIy3; 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 x63-20020a638642000000b00564c513ead5si1252908pgd.445.2023.08.25.01.41.17; Fri, 25 Aug 2023 01:41:33 -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=dkPreIy3; 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 S243300AbjHYHDY (ORCPT + 99 others); Fri, 25 Aug 2023 03:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241222AbjHYHCP (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 3D462D3 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 CFE1366687 for ; Fri, 25 Aug 2023 07:02:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C65C2C433CA; Fri, 25 Aug 2023 07:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692946932; bh=hWAFzzHi0f8GJ8d/XqWNtBifyZV9et10joWelVvsYPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkPreIy3HY7ZSyLURg3Hu+jdnXzNcHOwtX7KxbGMxh1fH1cpPzQk/YB9J81BRBAF0 Tkixd119q+Ce+2h2RG6thAPTPNF9zPGG7RlZ3R3Q7BzGqJf/DNaxnxvU7xzny8cvIg YXkiMteTBHGdKuvqX5R52g8Dg0yZmANfmXfVJJxuhkSI+KZ7UnbGx8XWeAkNYN/OKz EqipkXjYuva1+3XkEPmF7danzSAkj/J8KqrA0idFUm2T843BYJhsVFECfLnlkyfgjc tiVZfHBw4QwF5+Poj1jjzpp3Jz0oijmZfdXbvvBP/gdVc1hrH/1aXdaUd6mck3auZx WE/rYZOHxn/Sw== 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 17/23] x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block Date: Fri, 25 Aug 2023 00:01:48 -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=-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 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 06216159d7fc..b086fd46fa1b 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