Re: [PATCH] KVM: nVMX: Track vmx emulation errors

From: Sean Christopherson

Date: Wed Feb 25 2026 - 15:18:52 EST


On Tue, Jan 20, 2026, Fred Griffoul wrote:
> From: Fred Griffoul <fgriffo@xxxxxxxxxxxx>
>
> Add a new kvm_stat vcpu counter called "nested_errors" to track the
> number of errors returned to an L1 hypervisor when emulated VMX
> instructions fail.

This is too broad/vague, and very imperfect. E.g. if a guest is tripping on a
specific VMREAD for whatever reason, it will pollute the count and make it hard
to detect more serious issues like VM-Entry failures. And if VMCS shadowing is
in use, KVM could easily underreport meaningful errors.

I also dislike implementing this for nVMX but not nSVM. nSVM doesn't have the
same ISA surface and so many of the errors simply don't exist, but at the very
least VMRUN failures should be accounted.

And counting VM-Fail but not faults is rather odd if the goal is to monitor L1
hypervisor health.

> This counter should help monitor nVMX health and troubleshoot issues
> with L1 hypervisors.

There are lots of ways to monitor the health of L1 hypervisors, it's not clear to
me why we need a KVM-provide stat for VM-Fail.