Re: [PATCH v2] x86/speculation/srbds: do not try to turn mitigation off when not supported
From: Pawan Gupta
Date: Thu Mar 31 2022 - 12:25:42 EST
On Thu, Mar 31, 2022 at 05:25:27PM +0200, Borislav Petkov wrote:
On Thu, Mar 31, 2022 at 03:18:42PM +0200, Ricardo Cañuelo wrote:
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?
Yes, this should be fine as update_srbds_msr() would also check for
X86_FEATURE_SRBDS_CTRL. If a hypervisor doesn't want a guest to write to
the MSR it should not export X86_FEATURE_SRBDS_CTRL.
Just do the simple thing I pasted earlier - no need to rewrite the whole
function for no good reason.
I was trying to address earlier comment on split logic in two functions.
I am okay with keeping it as is (and just adding X86_FEATURE_SRBDS_CTRL
check in update_srbds_msr()).
Thanks,
Pawan