From patchwork Sat Sep 23 12:20:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 143951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp272562vqu; Sat, 23 Sep 2023 09:41:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHb44WsKshnRpJSKEwhpcksYqXrRE6PmCpPhreX7DiiecDj12Sq90BXNoYKcHdKR4A+XhqB X-Received: by 2002:a17:902:b949:b0:1c4:4c0f:8d91 with SMTP id h9-20020a170902b94900b001c44c0f8d91mr1654004pls.69.1695487294288; Sat, 23 Sep 2023 09:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695487294; cv=none; d=google.com; s=arc-20160816; b=hzxeuBDd3T77A+Eg5XxpZAM5YF1CupEpOUaVQGDzAFoHQzzcCfLLB5F14Hpu/D4H+h 5J9xtXBlHf54GXYHi5KdNkYt4TsGjzTlM6zsEdvJuPzl2cClv74USZgrXZ3Sm/E8DzVM 5dWU7CiBbRNGKevfzS1bRJoQoHMDnGoFdPzjK1vZ50plFSvbw2fYfIKx/s12D/qX/6Nf NBFKb/FRcTSXKmgvMqZeaYEwa/GYZfrbOBVtn2J9KwmHQI9fKdU3qFwoCXutqNyBeIzB SiVsL7/icKaGv85Ky0TEVR9szO8wN3zDYVWNojeQZctOXxRQjLgCdosh5BxmjEW8mnOc YagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=stlAmcxOAboGL2b6dnLyuATcfWv28QQ78NzN6HWQE0c=; fh=TJa98jjcJcAUyvo2yQiOqi+wukdLlQU80th5XskGe8U=; b=ExJrdER0qg02tpvC7CO55mej8LcSoYCJv2xNC13dfcy8Bn41UJzohArC9jfuI1/R3M Ef3mDH2psVwerzTrnERoofUTi5WpgKtEt2mW5sRk/iPz/YOfYIGfEu25hi0tpQPoWs67 lKgosdAWWhXYjtLCDT0NkHuW8TJdBHEACcz2068S1jugMg+Lrzw/pGQcycPUeEZNfx78 XXEiZWARDRAzzHbakM5zWJCMj0YGlDpwKABflcg0yJkb8AaOtZkXDxARpyNRUgx0pLKy Drot3kERL9IZLug3OLzYzXankrxc88Gj/q/yW/uGPgmC2HhSMi8O8lGdrJjTzqgJogoQ 707w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ER38Zy4Z; dkim=neutral (no key) header.i=@linutronix.de header.b=IuQyn9as; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t20-20020a170902e1d400b001b3c63eba76si5950419pla.492.2023.09.23.09.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 09:41:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ER38Zy4Z; dkim=neutral (no key) header.i=@linutronix.de header.b=IuQyn9as; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A26378295BEE; Sat, 23 Sep 2023 05:21:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbjIWMVH (ORCPT + 29 others); Sat, 23 Sep 2023 08:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231690AbjIWMU3 (ORCPT ); Sat, 23 Sep 2023 08:20:29 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD751B0; Sat, 23 Sep 2023 05:20:14 -0700 (PDT) Date: Sat, 23 Sep 2023 12:20:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695471613; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=stlAmcxOAboGL2b6dnLyuATcfWv28QQ78NzN6HWQE0c=; b=ER38Zy4Z8zEzBUxf0f1e0kU1saLUP2BjYBMM1UYj/ZlUizt6eWKPUhz44mrrUHVzWxMXwA asBJq4y9+MhPCpU2+hqM4JXk8LqfQuPFwS0Xvp4m99uLQ1788s2DMIvFoRGVMPgn52Z05S Pmed2Nj9M8u6ISapccyk1tip7+/U/8MuEVsraYlALyre7SB4LxTrqmgbKjnM/RZgtWk5g4 iUEboR1LYDJ4dbeqItooGvG2b/VdVrPhBQNI2JhZ5rQbaQNzuY/apbc7kX7FHCZUwvjujG w3xpyC4UhLdyldNxoh/Wt+eKzkI0tHyjMDNTU9hB1V/aZQkSzR20wTCMGa3Wzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695471613; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=stlAmcxOAboGL2b6dnLyuATcfWv28QQ78NzN6HWQE0c=; b=IuQyn9asxBQg7bH8fhEgA5V9ze7oMRKaUo2xs5b2HS0IuJix3qRbu1Zyejzk8A5704ZQpl WAsKVJ1OSKdN4nDQ== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/bugs] x86/srso: Fix SBPB enablement for (possible) future fixed HW Cc: Josh Poimboeuf , Ingo Molnar , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <169547161292.27769.10567855784863707255.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 23 Sep 2023 05:21:50 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777461705954335564 X-GMAIL-MSGID: 1777847285134430700 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: 06c8c5f9db4e6103294dd528c09568131c2f520a Gitweb: https://git.kernel.org/tip/06c8c5f9db4e6103294dd528c09568131c2f520a Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:49 -07:00 Committer: Ingo Molnar CommitterDate: Sat, 23 Sep 2023 14:13:02 +02:00 x86/srso: Fix SBPB enablement for (possible) future fixed HW Make the SBPB check more robust against the (possible) case where future HW has SRSO fixed but doesn't have the SRSO_NO bit set. Fixes: 1b5277c0ea0b ("x86/srso: Add SRSO_NO support") Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/cee5050db750b391c9f35f5334f8ff40e66c01b9.1693889988.git.jpoimboe@kernel.org --- 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 10499bc..2859a54 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2496,7 +2496,7 @@ static void __init srso_select_mitigation(void) pr_info("%s%s\n", srso_strings[srso_mitigation], (has_microcode ? "" : ", no microcode")); pred_cmd: - if ((boot_cpu_has(X86_FEATURE_SRSO_NO) || srso_cmd == SRSO_CMD_OFF) && + if ((!boot_cpu_has_bug(X86_BUG_SRSO) || srso_cmd == SRSO_CMD_OFF) && boot_cpu_has(X86_FEATURE_SBPB)) x86_pred_cmd = PRED_CMD_SBPB; }