From nobody Tue Dec 16 23:59:17 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 81BC1CD54AB for ; Tue, 19 Sep 2023 09:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231703AbjISJpb (ORCPT ); Tue, 19 Sep 2023 05:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231527AbjISJpP (ORCPT ); Tue, 19 Sep 2023 05:45:15 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D52116; Tue, 19 Sep 2023 02:45:08 -0700 (PDT) Date: Tue, 19 Sep 2023 09:45:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695116707; 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=leWaSycILSS4X4zeyzKjCPrPTlKDGdOvZhfx2wmeabs=; b=yX5AdUwECepPDFIwnzAi7ZU5hWrVBwX1p27QR8FMdY9ALfF0JSKKv4rDrpM/ck7E2AJQHK lVYQDYqNZ53TOMplGHsyAvaiWaEyFOtV3E/g6wB9zKr0nRRUkR9UFJP/n+QCGMTzhNRc8n tnoaiRe/BhKaYSYpK2k+Q1Uq7DvOZMoMy4/X+/oRC2BInTeXHW6sc0fXJBG8fgdHs6duhU LqMvZwjPNqDFcT2/5vgqH0ksiN2A1IoOypX1Hi2SnF8KGpTFMSDwU4C/YjlyrbTVi8+Hju bbPbQ+Tx83Jrw94oiOH/zSS/wMpBcoSblxTMgQCUZe4ZT1qVhagZpM3p0OIPyA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695116707; 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=leWaSycILSS4X4zeyzKjCPrPTlKDGdOvZhfx2wmeabs=; b=lvBRSwrcT/cQrMdNlpLncGf5gy+38kHNZHOXfDrQ1kWihzmGQYJbl+Rn7I0MthfGxm3Xlh Sh04OaRKvx1FltDQ== 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/urgent] x86/srso: Fix srso_show_state() side effect Cc: Josh Poimboeuf , Ingo Molnar , "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <27d128899cb8aee9eb2b57ddc996742b0c1d776b.1693889988.git.jpoimboe@kernel.org> References: <27d128899cb8aee9eb2b57ddc996742b0c1d776b.1693889988.git.jpoimboe@kernel.org> MIME-Version: 1.0 Message-ID: <169511670668.27769.1658034763935646312.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/urgent branch of tip: Commit-ID: a8cf700c17d9ca6cb8ee7dc5c9330dbac3948237 Gitweb: https://git.kernel.org/tip/a8cf700c17d9ca6cb8ee7dc5c9330dbac= 3948237 Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:45 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 19 Sep 2023 10:53:34 +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 Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/27d128899cb8aee9eb2b57ddc996742b0c1d776b.16= 93889988.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)