From: Sean Christopherson <seanjc@google.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: x86: Suppress WARNs on nested_run_pending after userspace exit
Date: Thu, 12 Mar 2026 07:22:05 -0700 [thread overview]
Message-ID: <abLMDY058srp_rT8@google.com> (raw)
In-Reply-To: <CAO9r8zOJoc6R9WnYqKxFhssk5d7+TFt+6WGok1Nof=-DJK8pcw@mail.gmail.com>
On Wed, Mar 11, 2026, Yosry Ahmed wrote:
> On Wed, Mar 11, 2026 at 6:27 AM Sean Christopherson <seanjc@google.com> 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
Oh, I know why I put it here. I didn't want to change nested_run_pending if
kvm_x86_vcpu_pre_run() rejected KVM_RUN. But looking at this again, it doesn't
actually matter because for the "untrusted" state to matter, KVM must get past
kvm_x86_vcpu_pre_run() at some point.
prev parent reply other threads:[~2026-03-12 14:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 22:45 [PATCH 0/2] KVM: x86: Syzkaller nested_run_pending defense Sean Christopherson
2026-03-10 22:45 ` [PATCH 1/2] KVM: x86: Move nested_run_pending to kvm_vcpu_arch Sean Christopherson
2026-03-10 22:45 ` [PATCH 2/2] KVM: x86: Suppress WARNs on nested_run_pending after userspace exit Sean Christopherson
2026-03-11 1:53 ` Yosry Ahmed
2026-03-11 13:27 ` Sean Christopherson
2026-03-11 18:23 ` Yosry Ahmed
2026-03-12 14:22 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abLMDY058srp_rT8@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=yosry@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.