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

From: Pawan Gupta
Date: Wed Jun 07 2023 - 16:21:45 EST


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@xxxxxxxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

LGTM.

Reviewed-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>