From nobody Fri Feb 13 02:47:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6810F13D2A4 for ; Thu, 11 Apr 2024 05:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712814123; cv=none; b=K8VbYlOygoeS/bokf2+D/tADsclUtUhVFEB5PTlJ4riXhMpYB375bqSulGDGCatd8uLelz0GHnYdRUseoC9X6hQja2164NVD/Xudj4isgwrWBwyFFEUFRjDgOSeAimnx7bCnxutwLEsfbrIH5+zMSa69CVo3402IJWSDmozhcqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712814123; c=relaxed/simple; bh=KQx6hDUWnvUOuYNyPwwD89X61R37BaI4V8lXYtXRZlw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j6nmHEeFGAjKgkVOOHyVyIbxp2l+r7cIaCW8Lr5fdGuV5SoX+zlTgDf1Gpo8Bl8OpNot3Xm7s2zvYr8MftJ0yONXsnvQySQIthHpoXB5imnkvXEMj3+1OSzbwSJKrTrn7lPtU0DaL5V5HHSutNnUKYK7tczO/nQN65RocABfsEk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kPStNLbj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kPStNLbj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 434DCC433A6; Thu, 11 Apr 2024 05:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712814122; bh=KQx6hDUWnvUOuYNyPwwD89X61R37BaI4V8lXYtXRZlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kPStNLbjmcKfkwPiwTZIqauu7Lkn/tpQUumlR6v3sU0cAkdhkK/BUf0OtX2uapkNx 42z26hSoFyRg14ls+mPzwHj6xL/QiI31Iu0u9fmuiqUagpP/Iw/43ziv+ckIPlwVlZ x2NnuLaWRLzHyxrGgZnhg74mrwVbWXJVglp9+RT5sMK+Ap2VEK1oH/GbVzj2zqReTl WBIZ/e7QoLCvZALFejevaU4x1/XuqikeQyNvy+F+C4KZPLE+0KaFdcRhdmuZmR5nAD lzMKx2mhf803RnTPBny+vd5zk8bM/NdrrRBTGuDnN2e64eh249w+5PmFmoMpueyZ8l qhFsL492MFffQ== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Andrew Cooper , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov Subject: [PATCH 7/7] x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI Date: Wed, 10 Apr 2024 22:40:51 -0700 Message-ID: <3833812ea63e7fdbe36bf8b932e63f70d18e2a2a.1712813475.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For consistency with the other CONFIG_MITIGATION_* options, replace the CONFIG_SPECTRE_BHI_{ON,OFF} options with a single CONFIG_MITIGATION_SPECTRE_BHI option. Signed-off-by: Josh Poimboeuf --- arch/x86/Kconfig | 17 +++-------------- arch/x86/kernel/cpu/bugs.c | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b63b6767a63d..4474bf32d0a4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2633,27 +2633,16 @@ config MITIGATION_RFDS stored in floating point, vector and integer registers. See also =20 -choice - prompt "Clear branch history" +config MITIGATION_SPECTRE_BHI + bool "Mitigate Spectre-BHB (Branch History Injection)" depends on CPU_SUP_INTEL - default SPECTRE_BHI_ON + default y help Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks where the branch history buffer is poisoned to speculatively steer indirect branches. See =20 -config SPECTRE_BHI_ON - bool "on" - help - Equivalent to setting spectre_bhi=3Don command line parameter. -config SPECTRE_BHI_OFF - bool "off" - help - Equivalent to setting spectre_bhi=3Doff command line parameter. - -endchoice - endif =20 config ARCH_HAS_ADD_PAGES diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 74ade6d7caa3..4c46fa2d08c2 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1628,7 +1628,7 @@ enum bhi_mitigations { }; =20 static enum bhi_mitigations bhi_mitigation __ro_after_init =3D - IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OF= F; + IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MI= TIGATION_OFF; =20 static int __init spectre_bhi_parse_cmdline(char *str) { --=20 2.44.0