lkml.org 
[lkml]   [2023]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 6/6] KVM: VMX: Move VERW closer to VMentry for MDS mitigation
On Fri, Dec 01, 2023 at 12:02:47PM -0800, Josh Poimboeuf wrote:
> On Fri, Oct 27, 2023 at 07:39:12AM -0700, Pawan Gupta wrote:
> > - vmx_disable_fb_clear(vmx);
> > + /*
> > + * Optimize the latency of VERW in guests for MMIO mitigation. Skip
> > + * the optimization when MDS mitigation(later in asm) is enabled.
> > + */
> > + if (!cpu_feature_enabled(X86_FEATURE_CLEAR_CPU_BUF))
> > + vmx_disable_fb_clear(vmx);
> >
> > if (vcpu->arch.cr2 != native_read_cr2())
> > native_write_cr2(vcpu->arch.cr2);
> > @@ -7248,7 +7256,8 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
> >
> > vmx->idt_vectoring_info = 0;
> >
> > - vmx_enable_fb_clear(vmx);
> > + if (!cpu_feature_enabled(X86_FEATURE_CLEAR_CPU_BUF))
> > + vmx_enable_fb_clear(vmx);
> >
>
> It may be cleaner to instead check X86_FEATURE_CLEAR_CPU_BUF when
> setting vmx->disable_fb_clear in the first place, in
> vmx_update_fb_clear_dis().

Right. Thanks for the review.

\
 
 \ /
  Last update: 2023-12-20 02:27    [W:0.059 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site