Re: [PATCH 2/2] KVM: x86: Suppress WARNs on nested_run_pending after userspace exit
From: Sean Christopherson
Date: Wed Mar 11 2026 - 09:29:36 EST
On Tue, Mar 10, 2026, Yosry Ahmed wrote:
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 879cdeb6adde..cad16c83dcff 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -12090,6 +12090,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
> > if (r <= 0)
> > goto out;
> >
> > + /*
> > + * If userspace may have modified vCPU state, mark nested_run_pending
> > + * as "untrusted" to avoid triggering false-positive WARNs.
> > + */
> > + if (vcpu->arch.nested_run_pending == KVM_NESTED_RUN_PENDING)
> > + vcpu->arch.nested_run_pending = KVM_NESTED_RUN_PENDING_UNTRUSTED;
> > +
>
> Why not inside kvm_x86_vcpu_pre_run()?
That, is a very good question. /facepalm