Re: [kvm-unit-tests PATCH v5 3/3] x86: Check platform vPMU capabilities before run lbr tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> Signed-off-by: Yang Weijiang <weijiang.yang@xxxxxxxxx>
> 
> ---
> 
> 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.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux