BPF List
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: jpoimboe@kernel.org, mingo@redhat.com, tglx@linutronix.de,
	bp@alien8.de, x86@kernel.org, leit@meta.com,
	"open list:BPF [MISC]:Keyword:(?:b|_)bpf(?:b|_)"
	<bpf@vger.kernel.org>
Subject: Re: [PATCH v5 00/12] x86/bugs: Add a separate config for each mitigation
Date: Tue, 24 Oct 2023 02:50:21 -0700	[thread overview]
Message-ID: <ZTeTXcTy1tsn/msq@gmail.com> (raw)
In-Reply-To: <CALOAHbDreP4JpL_C=+mkpwRvMpkVDdE-LNxkN=oyJW2vPjM_GQ@mail.gmail.com>

Hello Yafang,

On Mon, Oct 23, 2023 at 10:59:13AM +0800, Yafang Shao wrote:
> On Fri, Oct 20, 2023 at 2:12 AM Breno Leitao <leitao@debian.org> wrote:
> >
> > Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated,
> > where some mitigations have entries in Kconfig, and they could be
> > modified, while others mitigations do not have Kconfig entries, and
> > could not be controlled at build time.
> >
> > The fact of having a fine grained control can help in a few ways:
> >
> > 1) Users can choose and pick only mitigations that are important for
> > their workloads.
> >
> > 2) Users and developers can choose to disable mitigations that mangle
> > the assembly code generation, making it hard to read.
> >
> > 3) Separate configs for just source code readability,
> > so that we see *which* butt-ugly piece of crap code is for what
> > reason.
> >
> > Important to say, if a mitigation is disabled at compilation time, it
> > could be enabled at runtime using kernel command line arguments.
> 
> Hi Breno,
> 
> Do you have any plans to introduce utility functions for runtime
> checks on whether specific mitigations are disabled? Such helpers
> would be quite valuable; for instance, we could utilize them to
> determine if Spectre v1 or Spectre v4 mitigations are disabled in
> BPF[1].

I am not planning to. The check if a mitigation is enabled or not is a
different topic, that also might require some further refactor.

This patch set focuses in the initialization of the mitigation code
at build time. Initializating the mitigation code might not result in
the mitigation being enabled in runtime.

For instance, you can build the kernel to mitigate the GDS, but the
runtime detects that you are running in a guest VM, and depend on the
host to do the mitigation, so, the mitigation might be enabled or not,
even if it is initialized with CONFIG_GDS_FORCE_MITIGATION=y.

Detecting if the mitigation is enabled or not is an orthogonal problem
than the one I am trying to solve with this patch set.

      reply	other threads:[~2023-10-24  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 18:11 [PATCH v5 00/12] x86/bugs: Add a separate config for each mitigation Breno Leitao
2023-10-19 18:11 ` [PATCH v5 05/12] x86/bugs: Rename RETPOLINE to MITIGATION_RETPOLINE Breno Leitao
2023-10-19 18:11 ` [PATCH v5 06/12] x86/bugs: Rename SLS to CONFIG_MITIGATION_SLS Breno Leitao
2023-10-23  2:59 ` [PATCH v5 00/12] x86/bugs: Add a separate config for each mitigation Yafang Shao
2023-10-24  9:50   ` Breno Leitao [this message]

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=ZTeTXcTy1tsn/msq@gmail.com \
    --to=leitao@debian.org \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=laoar.shao@gmail.com \
    --cc=leit@meta.com \
    --cc=mingo@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox