[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250602192346.654-1-khaliidcaliy@gmail.com>
Date: Mon, 2 Jun 2025 19:22:44 +0000
From: Khalid Ali <khaliidcaliy@...il.com>
To: bp@...en8.de
Cc: dave.hansen@...ux.intel.com,
hpa@...or.com,
jpoimboe@...nel.org,
khaliidcaliy@...il.com,
linux-kernel@...r.kernel.org,
mingo@...hat.com,
pawan.kumar.gupta@...ux.intel.com,
peterz@...radead.org,
tglx@...utronix.de,
x86@...nel.org
Subject: Re: [PATCH] kernel/cpu/bugs: log ltf1 mitigation status
> > 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@...il.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
Powered by blists - more mailing lists