Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp196399lqg; Wed, 10 Apr 2024 22:43:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSRU3khozXxL2jG8xZD09GXtcJFypB2+TlJZpfCZnU1X1ZvVBFVw0npajEFNuTu/uydKoT6DBmBRi849SOjZolXbBEGff9BZL0ntYZAQ== X-Google-Smtp-Source: AGHT+IHHeZkc6OFHYitC9UXevccBQ1T9Hzf+daEt7jswSECp7LP0GBBs37Y5qnIstzlcdn7bKFV0 X-Received: by 2002:ad4:5912:0:b0:699:1c2f:7f7b with SMTP id ez18-20020ad45912000000b006991c2f7f7bmr2853249qvb.19.1712814219772; Wed, 10 Apr 2024 22:43:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712814219; cv=pass; d=google.com; s=arc-20160816; b=Md2Diu3C8XGvt3tXITJ6Nybz+NPMQ8/SAMYXFbQ461LPX260y+Lr+Ur22Jfpt2NpWg eGyPh+P6fFIswn2hm+FrSnyPktuGRr8EqRmWaUX9+OUKCA9ftUNxbgfp6kYXgWJuOLRV h4p6L743VzKOVUMsWsBLGPD1BhxNFCd04ViNukuvvddur0WXXANmK7lW/ZkM2zEXZoyU c4e0GtNvNnX3GEyRlSZ+TJkZyNK3OcAlOCfDbpux0pSmh9B11JDu1IAE48b7WkopJW1S GcFC5BluEYiXVWd3x5RICKl8BpJ8MMFFYYYT1AD0Jgges1QLiV7qKQskQFiHnViafuOz eqPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SXwCX+t76SmkfumQ23dNNLpTH/XPDCmAPZlwkEwvxD8=; fh=7OJFrLnOA6s1ycE/HULnfMliS+3S6sqMIgc3sc3R36M=; b=s3/LPN0mLF3o2g40r+Gr1lEkPOPEE9LrqREQYimc/TptBWz1XU1+GBIcllgiw/xIDU Tt6KCgJATQrCaCgYg0niH5ssAJZ9Qq2tGR0DeMlyNK9F/x6Ou4xdS/40FV2VCzo03+4f ZYlz7KwmRl8nNOPrtccLLLtkOswwu1RUVoO3ISEK+U9J9PAd16FYY4UYGIJFsmxgsLfu UB+Jv/5MDjGHYzZbm1l8mQ02XE34hm+LjTYELLJZCePSMEelVlti70ykkRZ0g1ksPgJG O03laWZCw2XZUEF0CGb7YmxdMB8mAC7FQ6s8Xo5nMdTb3ijfzV0uoZYwL+y7im8Fr16k Yi9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kPStNLbj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jk8-20020ad45d48000000b0069b4fe05694si58852qvb.483.2024.04.10.22.43.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 22:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kPStNLbj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EC0AF1C23C9B for ; Thu, 11 Apr 2024 05:43:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46B4013D60F; Thu, 11 Apr 2024 05:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kPStNLbj" 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 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: 8bit 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 -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 -config SPECTRE_BHI_ON - bool "on" - help - Equivalent to setting spectre_bhi=on command line parameter. -config SPECTRE_BHI_OFF - bool "off" - help - Equivalent to setting spectre_bhi=off command line parameter. - -endchoice - endif 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 { }; static enum bhi_mitigations bhi_mitigation __ro_after_init = - IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; + IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; static int __init spectre_bhi_parse_cmdline(char *str) { -- 2.44.0