All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: jpoimboe@kernel.org, peterz@infradead.org, tglx@linutronix.de,
	bp@alien8.de, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	leit@fb.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] x86/bugs: Create an option to disable MDS
Date: Fri, 16 Jun 2023 04:47:03 -0700	[thread overview]
Message-ID: <ZIxLt3/vWyoB/UIK@gmail.com> (raw)
In-Reply-To: <20230615221347.6ghb4d33tituxht4@desk>

On Thu, Jun 15, 2023 at 03:13:47PM -0700, Pawan Gupta wrote:
> On Thu, Jun 15, 2023 at 09:44:12AM -0700, Breno Leitao wrote:
> > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> > index 182af64387d0..50f12829dce9 100644
> > --- a/arch/x86/kernel/cpu/bugs.c
> > +++ b/arch/x86/kernel/cpu/bugs.c
> > @@ -269,6 +269,7 @@ static void x86_amd_ssb_disable(void)
> >  /* Default mitigation for MDS-affected CPUs */
> >  static enum mds_mitigations mds_mitigation __ro_after_init = MDS_MITIGATION_FULL;
> >  static bool mds_nosmt __ro_after_init = false;
> > +#define MDS_WARN_MSG "WARNING: Microarchitectural Data Sampling (MDS) speculative mitigation disabled!\n"
> >  
> >  static const char * const mds_strings[] = {
> >  	[MDS_MITIGATION_OFF]	= "Vulnerable",
> > @@ -278,11 +279,17 @@ static const char * const mds_strings[] = {
> >  
> >  static void __init mds_select_mitigation(void)
> >  {
> > -	if (!boot_cpu_has_bug(X86_BUG_MDS) || cpu_mitigations_off()) {
> > +	if (!boot_cpu_has_bug(X86_BUG_MDS)) {
> >  		mds_mitigation = MDS_MITIGATION_OFF;
> >  		return;
> >  	}
> >  
> > +	if (cpu_mitigations_off() || !IS_ENABLED(CONFIG_MITIGATE_MDS)) {
> > +		mds_mitigation = MDS_MITIGATION_OFF;
> > +		pr_err(MDS_WARN_MSG);
> > +		return;
> 
> Why does compile time config needs to be so restrictive that it does not
> allow runtime override with mds= cmdline?
> 
> I believe Kconfig should only be setting the mitigation default,
> allowing users to select mitigation at runtime:

Sure, that is doable as well. If no one has any opposition to it, I will
implemented as suggested.

  reply	other threads:[~2023-06-16 11:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 16:44 [PATCH 0/2] x86/bugs: Break down mitigations configurations Breno Leitao
2023-06-15 16:44 ` [PATCH 1/3] x86/bugs: Create an option to disable MDS Breno Leitao
2023-06-15 22:13   ` Pawan Gupta
2023-06-16 11:47     ` Breno Leitao [this message]
2023-06-15 16:44 ` [PATCH 2/3] x86/bugs: Create an option to disable TAA Breno Leitao
2023-06-15 16:44 ` [PATCH 3/3] x86/bugs: Create an option to disable MMIO vulnerability Breno Leitao
2023-06-15 16:44 ` [PATCH 0/2] x86/bugs: Break down mitigations configurations Breno Leitao
2023-06-15 16:44 ` [PATCH 1/2] x86/speculation: Disable mitigations if CONFIG says so Breno Leitao
2023-06-15 16:44 ` [PATCH 2/2] x86/speculation: Print error when mitigations are disabled Breno Leitao
2023-06-15 17:21 ` [PATCH 0/2] x86/bugs: Break down mitigations configurations Andi Kleen
2023-06-16  8:39   ` 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=ZIxLt3/vWyoB/UIK@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@fb.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.