RE: [PATCH v3 06/35] x86/bugs: Restructure mmio mitigation
From: Kaplan, David
Date: Fri Feb 21 2025 - 16:49:01 EST
[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Borislav Petkov <bp@xxxxxxxxx>
> Sent: Wednesday, February 19, 2025 12:21 PM
> To: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Cc: Kaplan, David <David.Kaplan@xxxxxxx>; Thomas Gleixner
> <tglx@xxxxxxxxxxxxx>; Peter Zijlstra <peterz@xxxxxxxxxxxxx>; Pawan Gupta
> <pawan.kumar.gupta@xxxxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>; Dave
> Hansen <dave.hansen@xxxxxxxxxxxxxxx>; x86@xxxxxxxxxx; H . Peter Anvin
> <hpa@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 06/35] x86/bugs: Restructure mmio mitigation
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Wed, Feb 12, 2025 at 03:16:46PM -0800, Josh Poimboeuf wrote:
> > static bool __init verw_mitigation_enabled(void) {
> > return mds_mitigation != MDS_MITIGATION_OFF ||
> > (taa_mitigation != TAA_MITIGATION_OFF && taa_vulnerable()) ||
> > (mmio_mitigation != MMIO_MITIGATION_OFF && mmio_needs_verw());
> > (rfds_mitigation != RFDS_MITIGATION_OFF &&
> > !rfds_needs_ucode()); }
>
> Instead of turning it into a head-scratching madness, it might be a lot easier if all the
> places which enable VERW mitigation, would do
>
> verw_mitigation_enabled = true;
>
> and then the code can simply check that static var...
>
Yeah, just implemented this and it does keep it pretty clean.
Thanks! --David Kaplan