Re: [PATCH v4 04/36] x86/bugs: Restructure rfds mitigation
From: Josh Poimboeuf
Date: Thu Apr 10 2025 - 12:25:33 EST
On Mon, Mar 10, 2025 at 11:39:51AM -0500, David Kaplan wrote:
> static void __init rfds_select_mitigation(void)
> {
> if (!boot_cpu_has_bug(X86_BUG_RFDS) || cpu_mitigations_off()) {
> rfds_mitigation = RFDS_MITIGATION_OFF;
> return;
> }
> - if (rfds_mitigation == RFDS_MITIGATION_OFF)
> - return;
The removal of this RFDS_MITIGATION_OFF check can cause
verw_mitigation_selected to get wrongly enabled below if it was
RFDS_MITIGATION_OFF to begin with.
I think it's only a bisection issue, that gets re-added later with
"x86/bugs: Add attack vector controls for rfds".
>
> if (rfds_mitigation == RFDS_MITIGATION_AUTO)
> rfds_mitigation = RFDS_MITIGATION_VERW;
>
> - if (x86_arch_cap_msr & ARCH_CAP_RFDS_CLEAR)
> + if (rfds_has_ucode())
> + verw_mitigation_selected = true;
> +}
--
Josh