Message ID | fc64c4e5749d10b398c86b60902d6f9394eb5012.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 z13csp2781513vqi; Sun, 20 Aug 2023 21:35:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3Gy/5KfbaaNUrnIzcBJYvYjUBaKIn6PmNCUrfwtf95DQfCyWyebsoZC6KvAhKVqkALixG X-Received: by 2002:a05:6512:304d:b0:4fb:be3c:d8b7 with SMTP id b13-20020a056512304d00b004fbbe3cd8b7mr4421498lfb.51.1692592535918; Sun, 20 Aug 2023 21:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692592535; cv=none; d=google.com; s=arc-20160816; b=TDGxbtBx6v6MLqtwK4AO0E0ijFZ/PbIe9ELFHidOUCks+uFS9lkfKrOVa3VvcTArG6 w9CxVP8a0V13A3dfTXJBL3OcUb9QPbiGBwraTyP5Zflyu0Ih9m12rc/FxhGD82NJ4Td8 wZroT+qvZmxSuHz0bEJQdBJ0rkHg9AYADRx6M6Z3GuWVlGtpcfe70MZCZWlMDeITugB9 dybjPwxBl6LWAp3a6kKVJ7HHCGcg834Qmndbk1JwPj39hM9OSZ7qKxmwJSrZNVOGdi/k hJ3LHZe0VFPiHiL4WUeBTcr1fS+cwQ5TCZNKAYQLZpAXMGVJa4+a0BP3gyoxLqB00Xg9 1QRA== 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=WpYnraIgbpbJGAAYEIQCz7RidN8m0w8NOh8GTMtxyHw=; fh=1KVrD/LnRsN9N7k2d12iARV4DA2tVMW012QtKSrD46c=; b=ScRK10bHhsY7PpHDaq9HiRm/j7rJPEZvzJ68p+GRc5tQBLP/Pap2cedX1WLlVkGb3L xvfjFHm1rhQ8xZu6ljHgpcxS4b7Qp4IM1Wo5mw2cvEOOu3UazTSBJwtctZU8tM2DRSfQ 38bEFZNoUt1BlzXqobTYzPlfNcauXnhXQP0a/KGbauZ6kh/FaD0WasboAG04zulhMNdT psjibyxH6yaorHF/cSKAX02t8PYvYYmV7CYeJAqIHNaI5AwOex3w9PkvA6Qc5/1WUiEV qP1YspwCsHzHt3L2pVVzsAaHbSGbJ1/w2lsjkuUIAJqiWo35v/nhZRpEwysTAa2/0JJQ jvZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oGTzd7iR; 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 v13-20020aa7d80d000000b005288947eebasi5066029edq.171.2023.08.20.21.35.12; Sun, 20 Aug 2023 21:35:35 -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=oGTzd7iR; 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 S232279AbjHUBTb (ORCPT <rfc822;chiang.bai@gmail.com> + 99 others); Sun, 20 Aug 2023 21:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231990AbjHUBTa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 20 Aug 2023 21:19:30 -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 D7396A0 for <linux-kernel@vger.kernel.org>; Sun, 20 Aug 2023 18:19:28 -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 4E4C8625FD for <linux-kernel@vger.kernel.org>; Mon, 21 Aug 2023 01:19:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 429C3C433C7; Mon, 21 Aug 2023 01:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692580767; bh=tZ4Q8jjAOGCCPRfVNc3rr+aMQROmytBONCwejjFqKCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oGTzd7iRf/KPOJw0aXefKaYcg8H6TV5xkkITQZwWCdz/IBieIjDZ3b9OcfkhMjGtZ V2abQsFrOYW+v8OYpnMkELoen6RT6Y/ZVwuRUqB6pfgrBvahjo7bnv/GlmDzX35LeG TJo55qbD7gekM5AiVxQqShYQQQ9KAUb+0EvgauRUThuSWDf/+cpsbAKu51VGOX131f 2Vs09GZFnyadGVT/64GC3mY+Kqazu3ZiaYuiLQGwYUbofZ4REnhILiv4C2aBGL9CUx K9o/Swr+FjhmzO8+M6oL8VRF0i0YO2r6+IgjryOvdvraP1zIMV9GsBj+Hs146t2EAT ppu/1Da+Mflaw== 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 01/22] x86/srso: Fix srso_show_state() side effect Date: Sun, 20 Aug 2023 18:18:58 -0700 Message-ID: <fc64c4e5749d10b398c86b60902d6f9394eb5012.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: 1774811911006138209 X-GMAIL-MSGID: 1774811911006138209 |
Series |
SRSO fixes/cleanups
|
|
Commit Message
Josh Poimboeuf
Aug. 21, 2023, 1:18 a.m. UTC
Reading the 'spec_rstack_overflow' sysfs file can trigger an unnecessary
MSR write, and possibly even a (handled) exception if the microcode
hasn't been updated.
Avoid all that by just checking X86_FEATURE_IBPB_BRTYPE instead, which
gets set by srso_select_mitigation() if the updated microcode exists.
Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation")
Signed-off-by: Josh Poimboeuf <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 f081d26616ac..bdd3e296f72b 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2717,7 +2717,7 @@ static ssize_t srso_show_state(char *buf) return sysfs_emit(buf, "%s%s\n", srso_strings[srso_mitigation], - (cpu_has_ibpb_brtype_microcode() ? "" : ", no microcode")); + boot_cpu_has(X86_FEATURE_IBPB_BRTYPE) ? "" : ", no microcode"); } static ssize_t gds_show_state(char *buf)