All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: leit@meta.com,
	"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" 
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] x86/bugs: Add a separate config for each mitigation
Date: Thu, 28 Sep 2023 05:45:32 -0700	[thread overview]
Message-ID: <ZRV1bIuSXjZ+uPKB@gmail.com> (raw)
In-Reply-To: <20230628142129.2468174-1-leitao@debian.org>

On Wed, Jun 28, 2023 at 07:21:28AM -0700, leitao@debian.org wrote:
> From: Breno Leitao <leitao@debian.org>
> 
> Create an entry for each CPU mitigation under
> CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable
> them at compilation time.
> 
> If a mitigation is disabled at compilation time, it could be enabled at
> runtime using kernel command line arguments.

I had a chat about this topic with Boris and Thomas at Kernel Recipes,
and I would like to summarize the current state, and get it moving
forward.

1) The hardware mitigations are half-way added to KCONFIG. I.e., half of
the hardware mitigations are specified under SPECULATION_MITIGATIONS,
but not all of them.
	* You can enabled/disabled just half of them at build time.

2) It is impossible to build a kernel with speculative mitigations
disabled.
	* The only way to disable the mitigations is at boot time,
	  using the "mitigations=off" boot parameter.


So, disabling SPECULATION_MITIGATIONS, will only disable the mitigations
that are under SPECULATION_MITIGATIONS. Other mitigations will continue
to be enabled by default. This is is misleading for the user.

Here are a few options moving forward:

1) Create one Kconfig entry per mitigation, so, the user can pick and
choose what to enable and disable. (Version 3 of this patch. May need a
re-spin due to the new mitigations being added.)

2) Keep the Kconfig entries as-is. Create a new Kconfig entry
(CPU_MITIGATIONS_DEFAULT_OFF?) to disable the mitigations by default,
similarly to the `mitigations=off` boot parameter (v1 of this patch)

3) Same as 2, but, reusing SPECULATION_MITIGATIONS instead of
creating a new Kconfig entry.

4) Remove the current entries in SPECULATION_MITIGATIONS and the fine
control on what to enable/disable?!

What is the preferred way?

  reply	other threads:[~2023-09-28 12:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 14:21 [PATCH v3] x86/bugs: Add a separate config for each mitigation leitao
2023-09-28 12:45 ` Breno Leitao [this message]
2023-09-28 13:40   ` Dave Hansen
2023-09-28 13:57     ` Breno Leitao
2023-09-28 16:33     ` Pawan Gupta
2023-10-05 16:25   ` Borislav Petkov
2023-10-05 18:29     ` Linus Torvalds
2023-10-06  9:54       ` Borislav Petkov
2023-10-06 10:59         ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZRV1bIuSXjZ+uPKB@gmail.com \
    --to=leitao@debian.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=leit@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.