Re: [PATCH 2/2] KVM: x86: Suppress WARNs on nested_run_pending after userspace exit
From: Yosry Ahmed
Date: Wed Mar 11 2026 - 14:24:00 EST
On Wed, Mar 11, 2026 at 6:27 AM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> 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
After moving it to kvm_x86_vcpu_pre_run(), feel free to add:
Reviewed-by: Yosry Ahmed <yosry@xxxxxxxxxx>