Re: [PATCH] KVM: nVMX: Add VM-Enter failed tracepoints for super early checks

From: Sean Christopherson
Date: Wed Sep 02 2020 - 18:14:37 EST


On Tue, Sep 01, 2020 at 10:21:15AM +0200, Vitaly Kuznetsov wrote:
> Sean Christopherson <sean.j.christopherson@xxxxxxxxx> writes:
>
> > Add tracepoints for the early consistency checks in nested_vmx_run().
> > The "VMLAUNCH vs. VMRESUME" check in particular is useful to trace, as
> > there is no architectural way to check VMCS.LAUNCH_STATE, and subtle
> > bugs such as VMCLEAR on the wrong HPA can lead to confusing errors in
> > the L1 VMM.
> >
> > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
> > ---
> > arch/x86/kvm/vmx/nested.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> > index 23b58c28a1c92..fb37f0972e78a 100644
> > --- a/arch/x86/kvm/vmx/nested.c
> > +++ b/arch/x86/kvm/vmx/nested.c
> > @@ -3468,11 +3468,11 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
> > if (evmptrld_status == EVMPTRLD_ERROR) {
>
> Would it make sense to add 'CC' here too for, em, consistency? :-) #UD
> is probably easy to spot anyway..

I'd prefer not to, purely because it's a #UD and not a VM-Fail.