All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Jeremiah McReynolds <jmcrey@google.com>
Cc: kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH] x86/msr: Disable PMU for MSR tests
Date: Thu, 17 Sep 2026 12:36:23 -0700	[thread overview]
Message-ID: <aqxBNxlhV8WbFxo7@google.com> (raw)
In-Reply-To: <20260917172651.3322899-1-jmcrey@google.com>

On Thu, Sep 17, 2026, Jeremiah McReynolds wrote:
> QEMUv11 introduced a check when PMU is enabled to ensure that the
> virtualized CPU is the same as the underlying host CPU[1]. The MSR test
> always runs under GenuineIntel with the max CPU model, so PMU is
> implicitly enabled. However, when run on AMD, this new check in QEMU
> causes the test to fail with the log: "host doesn't support requested
> feature: vPMU".
> 
> Explicitly disable PMU on the MSR test to avoid this failure.
> 
> [1]: https://gitlab.com/qemu-project/qemu/-/commit/4c7f05232cd1db5db114d36be2b210d24f1b9ad3
> 
> Signed-off-by: Jeremiah McReynolds <jmcrey@google.com>
> ---
>  x86/unittests.cfg | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> index ae731a93..06fe92f9 100644
> --- a/x86/unittests.cfg
> +++ b/x86/unittests.cfg
> @@ -174,9 +174,10 @@ arch = x86_64
>  # Use GenuineIntel to ensure SYSENTER MSRs are fully preserved, and to test
>  # SVM emulation of Intel CPU behavior.  Use the max CPU model so that 64-bit
>  # support follows the host kernel.  Running a 32-bit guest on a 64-bit host
> -# will fail due to shortcomings in KVM.
> +# will fail due to shortcomings in KVM.  The max CPU model turns on PMU, but
> +# Intel PMU registers cannot be virtualized on AMD, so turn it off.
>  file = msr.flat
> -qemu_params = -cpu max,vendor=GenuineIntel
> +qemu_params = -cpu max,vendor=GenuineIntel,pmu=off

I double checked that "pmu" has existed for a while; it goes back all the way to
QEMU v1.6.0, so we should be good on that front.

>  
>  [msr64]
>  # Same as above, but with a minimal 64-bit CPU model to validate cases where an
> -- 
> 2.55.0.1082.g2b9226bbc0-goog
> 

  reply	other threads:[~2026-09-17 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 17:26 [kvm-unit-tests PATCH] x86/msr: Disable PMU for MSR tests Jeremiah McReynolds
2026-09-17 19:36 ` Sean Christopherson [this message]
2026-09-25 22:44 ` Sean Christopherson

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=aqxBNxlhV8WbFxo7@google.com \
    --to=seanjc@google.com \
    --cc=jmcrey@google.com \
    --cc=kvm@vger.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.