Re: [PATCH v2] x86/speculation/srbds: do not try to turn mitigation off when not supported

Ricardo Cañuelo
2022-03-31T13:18:54Z

Pawan Gupta <pawan.kumar.gupta@linux.intel.com> writes:

Hi Pawan,

> void update_srbds_msr(void)
> {
> u64 mcu_ctrl;
>
> - if (!boot_cpu_has_bug(X86_BUG_SRBDS))
> - return;
> -
> - if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
> - return;
> -
> - if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED)
> + if (!boot_cpu_has_bug(X86_BUG_SRBDS) ||
> + !boot_cpu_has(X86_FEATURE_SRBDS_CTRL))
> return;

Just to clarify, this changes the behavior wrt the hypervisor case:
currently it just bails out of update_srbds_msr(), with your patch it'd
clear RNGDS_MITG_DIS from MSR_IA32_MCU_OPT_CTRL. Is that what you
intended?

Ricardo