The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Khalid Ali <khaliidcaliy@gmail.com>
To: bp@alien8.de
Cc: dave.hansen@linux.intel.com, hpa@zytor.com, jpoimboe@kernel.org,
	khaliidcaliy@gmail.com, linux-kernel@vger.kernel.org,
	mingo@redhat.com, pawan.kumar.gupta@linux.intel.com,
	peterz@infradead.org, tglx@linutronix.de, x86@kernel.org
Subject: Re: [PATCH] kernel/cpu/bugs: log ltf1 mitigation status
Date: Mon,  2 Jun 2025 19:22:44 +0000	[thread overview]
Message-ID: <20250602192346.654-1-khaliidcaliy@gmail.com> (raw)
In-Reply-To: <20250602090942.GAaD1qVv5182lZSPtK@fat_crate.local>

> > Log the L1TF mitigation like other mitigatioons. This one is is the
> > only one that doesn't get logged.
> >
> > Signed-off-by: Khalid Ali <khaliidcaliy@gmail.com>
> > ---
> > arch/x86/kernel/cpu/bugs.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> > index 7f94e6a5497d..38cb2a1b2849 100644
> > --- a/arch/x86/kernel/cpu/bugs.c
> > +++ b/arch/x86/kernel/cpu/bugs.c
> > @@ -2803,6 +2803,7 @@ static void __init l1tf_apply_mitigation(void)
> > 		return;
> > 	}
> >  
> > +	pr_info("Mitigation: PTE inversion\n");
> >  	setup_force_cpu_cap(X86_FEATURE_L1TF_PTEINV);
> >  }

> Pawan, what's the story here?
>
> There's this stuff further down in that file:
>
> | #define L1TF_DEFAULT_MSG "Mitigation: PTE Inversion"
> |         
> | #if IS_ENABLED(CONFIG_KVM_INTEL)
> | static const char * const l1tf_vmx_states[] = {
>
> which comes from 2018:
> 
> 72c6d2db64fa ("x86/litf: Introduce vmx status variable")
> 
> I guess it is about time we made this mitigation also follow the common
> pattern with the mitigation strings and issuing them at the right time?
>
> :-)
>
> Thx.

Exactly, this mitigation is the only one doesn't have string, 
so i thought it is odd. Not only this but we need to make all 
mitigations consistent.

I think the commit you mentioned (72c6d2db64fa ("x86/litf: Introduce vmx status variable"))
and mine have different context (one related to vmx and other common options), and i couldn't
find any string to express since enum values are basically different. enum l1tf_mitigations 
seems more general like "off" or "on" doesn't dictate any special mitigation option. So the 
simplest way maybe is to print the string like "PTE inversion".

Maybe we should move the macro at top of the function so it can print it. This is the only 
information we can print about L1TF mitigation.

Regards 
Khalid Ali

  reply	other threads:[~2025-06-02 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02  7:37 [PATCH] kernel/cpu/bugs: log ltf1 mitigation status Khalid Ali
2025-06-02  9:09 ` Borislav Petkov
2025-06-02 19:22   ` Khalid Ali [this message]
2025-06-02 19:27   ` Pawan Gupta

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=20250602192346.654-1-khaliidcaliy@gmail.com \
    --to=khaliidcaliy@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox