From: Sean Christopherson <seanjc@google.com>
To: mlevitsk@redhat.com
Cc: kvm@vger.kernel.org
Subject: Re: Question: 'pmu' kvm unit test fails when run nested with NMI watchdog on the host
Date: Tue, 24 Feb 2026 17:07:52 -0800 [thread overview]
Message-ID: <aZ5LaBCiG2PFFXyG@google.com> (raw)
In-Reply-To: <10d3f95717b7072e30576b7e3931ea277399fdf8.camel@redhat.com>
On Wed, Nov 05, 2025, mlevitsk@redhat.com wrote:
> Hi,
>
> I have a small, a bit philosophical question about the pmu kvm unit test:
The problem with philosophical questions is that they're never small :-)
> One of the subtests of this test, tests all GP counters at once, and it
> depends on the NMI watchdog being disabled, because it occupies one GP
> counter.
>
> This works fine, except when this test is run nested. In this case, assuming
> that the host has the NMI watchdog enabled, the L1 still can’t use all
> counters and has no way of working this around.
>
> Since AFAIK the current long term direction is vPMU, which is especially
> designed to address those kinds of issues, I am not sure it is worthy to
> attempt to fix this at L0 level (by reducing the number of counters that the
> guest can see for example, which also won’t always fix the issue, since there
> could be more perf users on the host, and NMI watchdog can also get
> dynamically enabled and disabled).
Agreed. For the emulated PMU, I think the only reasonable answer is that the
admin needs to understand the ramifications of exposing a PMU to the guest.
> My question is: Since the test fails and since it interferes with CI, does it
> make sense to add a workaround to the test, by making it use 1 counter less
> if run nested?
Hrm. I'd prefer not to? Mainly because reducing the number of used counters
seems fragile as it relies heavily on implementation details of pieces of the
stack beyond the current environment (the VM).
I don't suppose there's any way to configure your CI pipeline to disable the
host NMI watchdog?
> As a bonus the test can also check the NMI watchdog state and also reduce the
> number of tested counters instead of being skipped, improving coverage.
I don't think I followed this part. How would a test that runs nested be able
to query the host's NMI watchdog state?
Oh, you're saying in a non-nested scenario to reduce the number of counters.
For me personally, I prefer the SKIP, because it's noisier, i.e. tells me pretty
loudly that I forgot to turn off the watchdog. It's saved me from debugging
false failures at least once when running tests in a VM on the same host.
> Does all this make sense? If not, what about making the ‘all_counters’
> testcase optional (only print a warning) in case the test is run nested?
Printing a warning would definitely be my least favorite option. Tests that
print warns on failure inevitably get ignored. :-/
next prev parent reply other threads:[~2026-02-25 1:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 20:29 Question: 'pmu' kvm unit test fails when run nested with NMI watchdog on the host mlevitsk
2025-11-10 19:51 ` mlevitsk
2025-11-26 18:14 ` mlevitsk
2026-02-10 15:23 ` mlevitsk
2026-02-25 1:07 ` Sean Christopherson [this message]
2026-02-25 16:02 ` mlevitsk
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=aZ5LaBCiG2PFFXyG@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=mlevitsk@redhat.com \
/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