Re: [PATCH v3 06/35] x86/bugs: Restructure mmio mitigation

Borislav Petkov
2025-02-19T18:21:03Z

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...

--
Regards/Gruss,
Boris.