Re: [PATCH 2/2] KVM: VMX: Drop unnecessary vmx_fb_clear_ctrl_available "cache"

Pawan Gupta
2023-06-07T20:21:43Z

On Tue, Jun 06, 2023 at 05:43:10PM -0700, Sean Christopherson wrote:
> Now that KVM snapshots the host's MSR_IA32_ARCH_CAPABILITIES, drop the
> similar snapshot/cache of whether or not KVM is allowed to manipulate
> ARCH_CAPABILITIES.FB_CLEAR_CTRL. The motivation for the cache was

FB_CLEAR_CTRL is a read-only bit, I think you mean
MSR_IA32_MCU_OPT_CTRL.FB_CLEAR_DIS.

> presumably to avoid the RDMSR, e.g. boot_cpu_has_bug() is quite cheap, and
> modifying the vCPU's MSR_IA32_ARCH_CAPABILITIES is an infrequent option
> and a relatively slow path.
>
> Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>

LGTM.

Reviewed-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>