From nobody Wed Dec 17 22:45:03 2025 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 6075F14AD1A for ; Wed, 26 Jun 2024 06:02:15 +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=1719381735; cv=none; b=RYRQ4Ar3iWghMQGRZiLl9Xu6xUgqcGcmsjrMWL5/qVFjEltYsr9yNEPLIrClz/rA3RgZtcsL3YHIZQaZaY20fF0jjwY04aB3/cjllpJfUbARNvtDgD2eME8uUHqopRX5SY/btAQorMUZwZGajjjcROKg5Zgvao4LckKjmysVVKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719381735; c=relaxed/simple; bh=k+dtPWzbOil1sgDKHTHJbXRZWoGn2dqcKS5r+PR978U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c/nnrO9zl35Nc6KqM7yO5Mz3iCltncy+vvYSGBkhMjwB6p3533P9iO1uPPKb5v6A1ZS1dL0aELptV+rWm4lWlfzuDOpZCDO+SYVlboUKuXFrtNn1GicIa1a7RVq47ZSAGcF4hwJigPe+xymvbfJkjmiPHr5rVRxxVhhAcxoqFNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TAMRDTZF; 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="TAMRDTZF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04632C4AF0F; Wed, 26 Jun 2024 06:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719381735; bh=k+dtPWzbOil1sgDKHTHJbXRZWoGn2dqcKS5r+PR978U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TAMRDTZFcCNUVbNB55B/ickGz8X62DAu0mm5AGOndWUZmagWDpnUzcZ5O52LhdfyY p+CoBsaU2jbbpLsNA2CKaDfkKm4Eqac4rTS8NsKr+Q+eloIJ3K5CSeawAu1cD7ucuV 4evnJn9nbdEv7bKZs1qk8g058f1cL8fvFEpODndobhFuawW3Up7FcfbiSJlnbOJ+kQ 6QTXZkivJbKFVCTYSpXk15T763eUeSxx3vKZnfQWpRAKcO/icFs5Lm16PGpI6CP3uu fMjIpToH9J46lvsTkt8YcoUbfB3lkOQVMNL6FcbYEU6VT9Kyd4hjplt8NF3WaPujAt wSxVlUAD07mAQ== 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 , Ingo Molnar Subject: [PATCH v6 2/3] x86/bugs: Remove duplicate Spectre cmdline option descriptions Date: Tue, 25 Jun 2024 23:02:01 -0700 Message-ID: <450b5f4ffe891a8cc9736ec52b0c6f225bab3f4b.1719381528.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.45.1 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" Duplicating the documentation of all the Spectre kernel cmdline options in two separate files is unwieldy and error-prone. Instead just add a reference to kernel-parameters.txt from spectre.rst. Reviewed-by: Daniel Sneddon Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/hw-vuln/spectre.rst | 86 +++---------------- 1 file changed, 10 insertions(+), 76 deletions(-) diff --git a/Documentation/admin-guide/hw-vuln/spectre.rst b/Documentation/= admin-guide/hw-vuln/spectre.rst index 25a04cda4c2c..132e0bc6007e 100644 --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst @@ -592,85 +592,19 @@ Spectre variant 2 Mitigation control on the kernel command line --------------------------------------------- =20 -Spectre variant 2 mitigation can be disabled or force enabled at the -kernel command line. +In general the kernel selects reasonable default mitigations for the +current CPU. =20 - nospectre_v1 +Spectre default mitigations can be disabled or changed at the kernel +command line with the following options: =20 - [X86,PPC] Disable mitigations for Spectre Variant 1 - (bounds check bypass). With this option data leaks are - possible in the system. + - nospectre_v1 + - nospectre_v2 + - spectre_v2=3D{option} + - spectre_v2_user=3D{option} + - spectre_bhi=3D{option} =20 - nospectre_v2 - - [X86] Disable all mitigations for the Spectre variant 2 - (indirect branch prediction) vulnerability. System may - allow data leaks with this option, which is equivalent - to spectre_v2=3Doff. - - - spectre_v2=3D - - [X86] Control mitigation of Spectre variant 2 - (indirect branch speculation) vulnerability. - The default operation protects the kernel from - user space attacks. - - on - unconditionally enable, implies - spectre_v2_user=3Don - off - unconditionally disable, implies - spectre_v2_user=3Doff - auto - kernel detects whether your CPU model is - vulnerable - - Selecting 'on' will, and 'auto' may, choose a - mitigation method at run time according to the - CPU, the available microcode, the setting of the - CONFIG_MITIGATION_RETPOLINE configuration option, - and the compiler with which the kernel was built. - - Selecting 'on' will also enable the mitigation - against user space to user space task attacks. - - Selecting 'off' will disable both the kernel and - the user space protections. - - Specific mitigations can also be selected manually: - - retpoline auto pick between generic,lfence - retpoline,generic Retpolines - retpoline,lfence LFENCE; indirect branch - retpoline,amd alias for retpoline,lfence - eibrs Enhanced/Auto IBRS - eibrs,retpoline Enhanced/Auto IBRS + Retpolines - eibrs,lfence Enhanced/Auto IBRS + LFENCE - ibrs use IBRS to protect kernel - - Not specifying this option is equivalent to - spectre_v2=3Dauto. - - In general the kernel by default selects - reasonable mitigations for the current CPU. To - disable Spectre variant 2 mitigations, boot with - spectre_v2=3Doff. Spectre variant 1 mitigations - cannot be disabled. - - spectre_bhi=3D - - [X86] Control mitigation of Branch History Injection - (BHI) vulnerability. This setting affects the deployment - of the HW BHI control and the SW BHB clearing sequence. - - on - (default) Enable the HW or SW mitigation as - needed. - off - Disable the mitigation. - -For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt +For more details on the available options, refer to Documentation/admin-gu= ide/kernel-parameters.txt =20 Mitigation selection guide -------------------------- --=20 2.45.1