All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Yang Weijiang <weijiang.yang@intel.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v5 3/3] x86: Check platform vPMU capabilities before run lbr tests
Date: Fri, 8 Jul 2022 15:57:12 +0000	[thread overview]
Message-ID: <YshT2I8/lb8oU1a5@google.com> (raw)
In-Reply-To: <20220708051119.124100-3-weijiang.yang@intel.com>

On Fri, Jul 08, 2022, Yang Weijiang wrote:
> Use new helper to check whether pmu is available and Perfmon/Debug
> capbilities are supported before read MSR_IA32_PERF_CAPABILITIES to
> avoid test failure. The issue can be captured when enable_pmu=0.
> 
> Suggested-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
> 
> ---
> 
> v5:
>  Use new helpers to check pmu availability and get pmu version.[Sean]
> 
>  lib/x86/processor.h |  1 +
>  x86/pmu_lbr.c       | 31 ++++++++++++-------------------

What about x86/pmu.c?  It has pretty much all the same issues.

> @@ -74,19 +62,24 @@ int main(int ac, char **av)
>  		return 0;
>  	}
>  
> -	perf_cap = rdmsr(MSR_IA32_PERF_CAPABILITIES);
> -	eax.full = id.a;
> -
> -	if (!eax.split.version_id) {
> +	if (!cpu_has_pmu()) {
>  		printf("No pmu is detected!\n");

Please opportunistically switch these to report_skip() (and drop the \n), or fix
them in patch 1 too.  Either way is fine.  And obviously use report_skip() for
the new PDCM check.

  reply	other threads:[~2022-07-08 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  5:11 [kvm-unit-tests PATCH v5 1/3] x86: Use report_skip to log messages when tests are skipped Yang Weijiang
2022-07-08  5:11 ` [kvm-unit-tests PATCH v5 2/3] x86: Skip perf related tests when platform cannot support Yang Weijiang
2022-07-08  5:11 ` [kvm-unit-tests PATCH v5 3/3] x86: Check platform vPMU capabilities before run lbr tests Yang Weijiang
2022-07-08 15:57   ` Sean Christopherson [this message]
2022-07-08 15:51 ` [kvm-unit-tests PATCH v5 1/3] x86: Use report_skip to log messages when tests are skipped Sean Christopherson
2022-07-11  7:42   ` Yang, Weijiang

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=YshT2I8/lb8oU1a5@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=weijiang.yang@intel.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 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.