From nobody Wed Dec 17 00:00:19 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85393EE49BA for ; Fri, 25 Aug 2023 10:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244566AbjHYKU7 (ORCPT ); Fri, 25 Aug 2023 06:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244444AbjHYKUQ (ORCPT ); Fri, 25 Aug 2023 06:20:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 735BE213A; Fri, 25 Aug 2023 03:20:09 -0700 (PDT) Date: Fri, 25 Aug 2023 10:19:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692958776; 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=Se/OG4hmJ3gzyETXfJM284Lal6U3di06YIBvnpDzC9E=; b=Oe+KD6JV7LImknRI9iAC37pE5oHfriDYh+njwCLCwqL6qoBVPjumAWXHh44m0hGh2DrUu3 qvOaDs81YAQgHA8bxTgrYpWamMuKSDCLgqBun0i56+Nwh0+hvhqshMaI7sznKApsuYcjOo nNESzt1LUT1PRBFmxVpxklQry/KU4HgYDxHsaiOIZv3M+f+r/fQl6fFP2bw0biDnXamnlR aUIc5m5houlo/C9PHzA3II/WU7z8wpq477p9zuzIopZ5l3js+YCaTUWYCBKLhCSKwU0w5C nTpunS1CO8VYnileQRl4Qs7Fipf5Vs7odn9KmxW0H1qR742wwkba3J/Hb0jd2g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692958776; 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=Se/OG4hmJ3gzyETXfJM284Lal6U3di06YIBvnpDzC9E=; b=4Me3FimrBVuS2/SD68sAsFWgOC2feRau2rJSH2ky+AqgB5CXueXeiuOIfCUoCQa7D4V5PB pbiBsKISuCfjQgAQ== 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 srso_show_state() side effect Cc: Josh Poimboeuf , Ingo Molnar , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <40b2e6af3a94d2c6eb9a3afaa63f34ee910a17d0.1692919072.git.jpoimboe@kernel.org> References: <40b2e6af3a94d2c6eb9a3afaa63f34ee910a17d0.1692919072.git.jpoimboe@kernel.org> MIME-Version: 1.0 Message-ID: <169295877565.27769.402736621014345470.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/bugs branch of tip: Commit-ID: c17312ac07853597500572e91a0469169f73058f Gitweb: https://git.kernel.org/tip/c17312ac07853597500572e91a0469169= f73058f Author: Josh Poimboeuf AuthorDate: Fri, 25 Aug 2023 00:01:32 -07:00 Committer: Ingo Molnar CommitterDate: Fri, 25 Aug 2023 11:21:58 +02:00 x86/srso: Fix srso_show_state() side effect 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 Signed-off-by: Ingo Molnar Reviewed-by: Nikolay Borisov Link: https://lore.kernel.org/r/40b2e6af3a94d2c6eb9a3afaa63f34ee910a17d0.16= 92919072.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 f081d26..bdd3e29 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) =20 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"); } =20 static ssize_t gds_show_state(char *buf)