Re: [PATCH 2/3] x86/mmio: Rename cpu_buf_vm_clear to cpu_buf_vm_clear_mmio_only

From: Pawan Gupta

Date: Thu Oct 30 2025 - 01:40:23 EST


On Wed, Oct 29, 2025 at 05:18:19PM -0700, Sean Christopherson wrote:
> On Wed, Oct 29, 2025, Pawan Gupta wrote:
> > cpu_buf_vm_clear static key is only used by the MMIO Stale Data mitigation.
> > Rename it to avoid mixing it up with X86_FEATURE_CLEAR_CPU_BUF_VM.
> >
> > Signed-off-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>
> > ---
>
> ...
>
> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> > index f87c216d976d7d344c924aa4cc18fe1bf8f9b731..451be757b3d1b2fec6b2b79157f26dd43bc368b8 100644
> > --- a/arch/x86/kvm/vmx/vmx.c
> > +++ b/arch/x86/kvm/vmx/vmx.c
> > @@ -903,7 +903,7 @@ unsigned int __vmx_vcpu_run_flags(struct vcpu_vmx *vmx)
> > if (!msr_write_intercepted(vmx, MSR_IA32_SPEC_CTRL))
> > flags |= VMX_RUN_SAVE_SPEC_CTRL;
> >
> > - if (static_branch_unlikely(&cpu_buf_vm_clear) &&
> > + if (static_branch_unlikely(&cpu_buf_vm_clear_mmio_only) &&
> > kvm_vcpu_can_access_host_mmio(&vmx->vcpu))
> > flags |= VMX_RUN_CLEAR_CPU_BUFFERS_FOR_MMIO;
>
> The use in vmx_vcpu_enter_exit() needs to be renamed as well. The code gets
> dropped in patch 3, but intermediate builds will fail.

Ya, thanks for catching it.