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 v3 10/10] KVM: selftests: Trigger L2->L1 exits stress save+restore and #PF test
Date: Mon, 27 Jul 2026 09:38:44 -0700 [thread overview]
Message-ID: <ameJlMZbJtXs7bgL@google.com> (raw)
In-Reply-To: <CAO9r8zN9O=0cgO-ia1FtDQ-JvOau7fGUZ27wKP-WY7HmmKs9dw@mail.gmail.com>
On Mon, Jul 27, 2026, Yosry Ahmed wrote:
> > > As I mentioned above, I prefer taking a dependency on
> > > KVM_CAP_EXCEPTION_PAYLOAD rather than varying coverage. At least for
> > > the nested case, I think I can move the TEST_REQUIRE() into the
> > > 'nested' case, but then it's probably better to leave it as an arg to
> > > allow for meaningfully running the test in L0.
> >
> > The problem is that TEST_REQUIRE() skips the whole test, regardless of when it's
> > called. I.e. if you go that route, passes for the non-nested case will show up
> > as skips. TEST_REQUIRE() really is intended to be used when something is a hard
> > requirement.
> >
> > > Actually, what if we just skip the nested case completely if
> > > KVM_CAP_EXCEPTION_PAYLOAD isn't available?
> >
> > Can you use KVM_NMI instead of KVM_SET_VCPU_EVENTS to effect the nested #VMEXIT?
> > That ioctl is so ancient that I'm a-ok skipping any CAP check for it.
>
> Hmm actually I just realized I missed a CAP check for
> KVM_CAP_NESTED_STATE here. I don't think it's worth looking into
> dropping KVM_CAP_EXCEPTION_PAYLOAD, because we will need a CAP check
> anyway, and both of these were introduced very close in time (4.19 and
> 4.20, both 8 years ago).
>
> So I think the simplest thing to do here is just run the nested test
> cases if both CAPs are available and skip it otherwise. Practically, I
> doubt there will be a lot of people running upstream selftests on
> <4.20 kernels for this to actually matter.
Yeah, works for me.
prev parent reply other threads:[~2026-07-27 16:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 18:37 [PATCH v3 00/10] KVM: selftests: Stress save+restore and #PF (ft. nested) Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 01/10] KVM: selftests: Move STR() and XSTR() definitions to test_util.h Yosry Ahmed
2026-07-24 15:26 ` Sean Christopherson
2026-06-29 18:37 ` [PATCH v3 02/10] KVM: selftests: Fix RAX and RFLAGS VMCB offsets when running L2 Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 03/10] KVM: selftests: Use an array for guest_regs (and fix offsets) Yosry Ahmed
2026-07-24 15:33 ` Sean Christopherson
2026-07-24 16:18 ` Yosry Ahmed
2026-07-24 17:03 ` Sean Christopherson
2026-07-24 17:44 ` Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 04/10] KVM: selftests: Move GPR load/save definitions outside of nSVM code Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 05/10] KVM: selftests: Reuse GPR switching logic for nVMX Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 06/10] KVM: selftests: Drop HORRIFIC_L2_UCALL_CLOBBER_HACK Yosry Ahmed
2026-07-24 15:37 ` Sean Christopherson
2026-07-24 16:20 ` Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 07/10] KVM: selftests: Add basic stress test for save+restore and #PF handling Yosry Ahmed
2026-07-24 16:45 ` Sean Christopherson
2026-07-24 17:38 ` Yosry Ahmed
2026-07-24 18:12 ` Sean Christopherson
2026-07-24 18:25 ` Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 08/10] KVM: selftests: Trigger save+restore randomly in the #PF stress test Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 09/10] KVM: selftests: Support running stress save+restore and #PF test in L2 Yosry Ahmed
2026-07-24 17:37 ` Sean Christopherson
2026-07-24 17:40 ` Yosry Ahmed
2026-06-29 18:37 ` [PATCH v3 10/10] KVM: selftests: Trigger L2->L1 exits stress save+restore and #PF test Yosry Ahmed
2026-07-24 17:50 ` Sean Christopherson
2026-07-24 18:15 ` Yosry Ahmed
2026-07-24 18:25 ` Sean Christopherson
2026-07-24 18:35 ` Yosry Ahmed
2026-07-24 20:32 ` Sean Christopherson
2026-07-27 15:49 ` Yosry Ahmed
2026-07-27 16:38 ` 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=ameJlMZbJtXs7bgL@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox