Message ID | 141c92f20ab46cf0c028e86b946134cd702d0ea5.1692580085.git.jpoimboe@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2773771vqi; Sun, 20 Aug 2023 21:07:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6uPnyJTogT9R4EA3HMH1reVLiB8XJ7KZbHpDRWA/xyiqtUTM7gNDJTnWMGmeWspgtPXPr X-Received: by 2002:a05:6870:5608:b0:1bd:55be:5880 with SMTP id m8-20020a056870560800b001bd55be5880mr7803904oao.42.1692590860590; Sun, 20 Aug 2023 21:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692590860; cv=none; d=google.com; s=arc-20160816; b=AHLNHPehWci0AhpHDOSdlbIxNqo45cmBKENyLDTrvQS9VPj2S5IlatqeXlthKs77/v cPWNuvDAEge6OQrXgrTXrg4rmvuWtsCD4If3GoWuFlqaoQK7aGHkLAG6pj1jTjRECzeh b0ZsZt694p987TS0NEG/zLBjj6HcqDUpMeySWDzH91IsIcnZy/2xZKIvHdHsMV3uae6w Vt18PjmmItjpdjVea2BodvFNX00+qysCdgjHXrz9OAjFeaLTt29LWD9IyAjgDa83cuN6 orRlZdKSAGKnorYfWGlv0dbuzAD5bpkQEoMEC851LN96F5i5PSkY7pX4P6N9oQAflEQj ZTpw== 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=Q9+zy2SRPuRmibaN2flqwDs7CA6eGS+zSAAhtpT3NZw=; fh=1KVrD/LnRsN9N7k2d12iARV4DA2tVMW012QtKSrD46c=; b=05UJqDQiEsrdheW4dsZuHdc4gLrISgb6mqVnPi24jFE2i3Nv6oiJBPrAV7OO4iYLXa 8t8b++t9Dp6EL8eg4SW8byfCmdTU7+hTSwtU6aCXxk77RWLny0YczU8TaV0hkBZgyBie vKq2h8GP5JnKPltzmiMQbMvkO+A1j7seQ2rqaMl3PtComuQDGjvvnoku2a3clO0+Y3AC zqHGqFjcyRnfq1DNluiYEf0oU+ouIYHRmy7QJhdZoxoqT26r0M/3+StM97yFkNT5wm0U 07fXdM32wHIQZtfrKIWdC2EDJI2zE6kE9FclI8I3MYEfVjWQyGUxxbNhXB9V3lmwKvD4 08Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KFfuS7gl; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mv22-20020a17090b199600b002632a1243dbsi7744307pjb.104.2023.08.20.21.07.26; Sun, 20 Aug 2023 21:07:40 -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=KFfuS7gl; 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 S232314AbjHUBTj (ORCPT <rfc822;chiang.bai@gmail.com> + 99 others); Sun, 20 Aug 2023 21:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232280AbjHUBTc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 20 Aug 2023 21:19:32 -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 CF7BF9C for <linux-kernel@vger.kernel.org>; Sun, 20 Aug 2023 18:19:30 -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 AFAA762600 for <linux-kernel@vger.kernel.org>; Mon, 21 Aug 2023 01:19:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAC1BC433C8; Mon, 21 Aug 2023 01:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692580770; bh=1JVPtgGBWI8sOMGshKa4etXbpP/NdE2A1szA4ieQYNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KFfuS7glWuB7Z2a4DrXLRwBdhw4LYC7XgZB020eMoUN/861t1bqyK8TDkfN4PfKfx 0e3+jDBLlBLZlXKV00lAyvmGJSsyDlV0ix4cm467fYgNWHRwya23LDr56yvEYVJpBS kBAa0OZFOwwDMsoa9eTq9Pc+ErWD+utTnJQ5VfUngbeLk0S+eLucJkKEdjsRUvz7eZ j4zkjZ6tJQAxM7rOLtmTXMwPivQuI6hBBgMoTfzqKsl4CXeys1rUPpcUL5ZQoCsWED n+eorHqQLuSbYXV2IDzPggmRM8i7YBv1PPugTlNR2HlVd+XZSsCexu5fsDfZFAUp/7 rQGyBL+YfS3vQ== From: Josh Poimboeuf <jpoimboe@kernel.org> To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov <bp@alien8.de>, Peter Zijlstra <peterz@infradead.org>, Babu Moger <babu.moger@amd.com>, Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com>, David.Kaplan@amd.com, Andrew Cooper <andrew.cooper3@citrix.com>, Nikolay Borisov <nik.borisov@suse.com>, gregkh@linuxfoundation.org, Thomas Gleixner <tglx@linutronix.de> Subject: [PATCH 05/22] x86/srso: Fix SBPB enablement for mitigations=off Date: Sun, 20 Aug 2023 18:19:02 -0700 Message-ID: <141c92f20ab46cf0c028e86b946134cd702d0ea5.1692580085.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <cover.1692580085.git.jpoimboe@kernel.org> References: <cover.1692580085.git.jpoimboe@kernel.org> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774810154348005942 X-GMAIL-MSGID: 1774810154348005942 |
Series |
SRSO fixes/cleanups
|
|
Commit Message
Josh Poimboeuf
Aug. 21, 2023, 1:19 a.m. UTC
If the user has requested no mitigations with mitigations=off, use the
lighter-weight SBPB instead of IBPB for other mitigations.
Note that even with mitigations=off, IBPB/SBPB may still be used for
Spectre v2 user <-> user protection. Whether that makes sense is a
question for another day.
Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
arch/x86/kernel/cpu/bugs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 10499bcd4e39..ff5bfe8f0ee9 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2496,8 +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) && - boot_cpu_has(X86_FEATURE_SBPB)) + if (boot_cpu_has(X86_FEATURE_SBPB) && srso_mitigation == SRSO_MITIGATION_NONE) x86_pred_cmd = PRED_CMD_SBPB; }