From patchwork Tue Sep 19 09:53:15 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: 141811 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3272850vqi; Tue, 19 Sep 2023 03:32:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+BF8NUnzsBTr5PQww0ibaqTGRkTh5BwCAh2OilB9/x35u1x4oevkttcOTqX8pHwLLuVef X-Received: by 2002:a05:6359:5d04:b0:143:5d3f:f397 with SMTP id ps4-20020a0563595d0400b001435d3ff397mr518099rwb.16.1695119577352; Tue, 19 Sep 2023 03:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695119577; cv=none; d=google.com; s=arc-20160816; b=uDeahkmp0woj3X41ZzOitJNTieA6wKZUphZAvD8L/lzh80Z6lkOhco8mxsgDUaEUfW 5K+vA7N7ogmsl+imXEupV91HBeWtb1XX//eI0toAJz7ScL8UGGunS7O33hbN50ETZxNK d+2WvDsH89OYmmRVg7m7mg3pvqdvzg+g01VpL0/5Fiq67hoL/r8p4IolqwFkCAd9Wmgv jqXor65NO717ot6ruO6+10cxQh9ELaUYvDcJyPpdgGHNZdCIxdhr6XHAtVbfEIRjT6fc lyNxBfOZ3VkV8/nDb4a4SW3DQB6N1dvxjq77VlU4+xGRXoITx5wlHgSOq8Y2yqMncB2H NVWQ== 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=U115kkJUr4RUArQuHB6xSU1A3yQCELtyFJilkhh/WHs=; fh=TJa98jjcJcAUyvo2yQiOqi+wukdLlQU80th5XskGe8U=; b=FDNOu3rUmyHWO+8F2n0h3Mg1tiJ3DtMwLfekX8kVemTMWJkQQHvBuQvdmj2goG14zF fmzf1WXt5FWDcLWd5v/M/cgYsTU8xB7pEZQtEiu2H3cRjyPhm+bJgd1qpMHnF4+nio0e 98EYhJV8vpmNxVOqIp/dwTU7j/32tCohS0ISsnCGLEr1/Tv2P/CE0KS7+xrLrzqNovoC v8jLE/zqCQkGitYUZZ3etozQloglR3mpCCc0b2K3rNGsA83PIMmGd3dW4oDV0y0+z1Ot Qhw5dRQ4fbCv9nFAdDbsrE7AnNX4g5FfTDXM6pA17piBos5RM3uR1wgyIDxHNM4uKC0M qd+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=C34BO7vz; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i135-20020a636d8d000000b00577fa01934asi9422769pgc.162.2023.09.19.03.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=C34BO7vz; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 863368071201; Tue, 19 Sep 2023 02:55:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231880AbjISJyf (ORCPT + 26 others); Tue, 19 Sep 2023 05:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbjISJxZ (ORCPT ); Tue, 19 Sep 2023 05:53:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002EE137; Tue, 19 Sep 2023 02:53:17 -0700 (PDT) Date: Tue, 19 Sep 2023 09:53:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695117196; 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=U115kkJUr4RUArQuHB6xSU1A3yQCELtyFJilkhh/WHs=; b=C34BO7vzIRQl/wPdWuBzdx1LmcP68aHk1U01BG5L8MDxZvdHJWv1i52RcH8xGT1tDqcVGq Six9IoLB+o3R/RFRnE03hPvJ2UP7mQU5OBm1H5Awp/Vcej/jOQsJLcgy25rUm9Ru6um6+5 rCFVtQUNEd9YibW0XLbHvxCmq5vOKcVZTKUOe/tueOYrF+IJ4Q4d/8ksbdd9THkCNyXVEA jp7ABAudIEJvrmRS4WQu/McarCVEsvQalLt6Uihtjq7YFV7P8XKgIcvI2B3ssAnqW9xZuv t3sVK15OynsGvgRG96TwnUgZMeJ/ZA/0cr1IImCKdro3WTJqujD+wqgVLquGtw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695117196; 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=U115kkJUr4RUArQuHB6xSU1A3yQCELtyFJilkhh/WHs=; b=nEW0Dtdfhdcl6rQTkGSUwMIdjkxTkHrwMgsuoTNl7dOtPmRQ+yAChZb7gGE+96N8nCO75q JYNjXyLDaueefSDA== 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: <169511719558.27769.873036992380663838.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 02:55:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777461705954335564 X-GMAIL-MSGID: 1777461705954335564 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: 01bba38f23ed7ae627442015332333191af37a5a Gitweb: https://git.kernel.org/tip/01bba38f23ed7ae627442015332333191af37a5a Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:49 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 19 Sep 2023 11:42:46 +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; }