Re: [kvm-unit-tests PATCH v4 15/24] x86/pmu: Initialize PMU perf_capabilities at pmu_init()

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

 



On Mon, Oct 24, 2022, Like Xu wrote:
> From: Like Xu <likexu@xxxxxxxxxxx>
> 
> Re-reading PERF_CAPABILITIES each time when needed, adding the
> overhead of eimulating RDMSR isn't also meaningless in the grand
> scheme of the test.
> 
> Based on this, more helpers for full_writes and lbr_fmt can also
> be added to increase the readability of the test cases.
> 
> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Signed-off-by: Like Xu <likexu@xxxxxxxxxxx>
> ---
>  lib/x86/pmu.c |  3 +++
>  lib/x86/pmu.h | 18 +++++++++++++++---
>  x86/pmu.c     |  2 +-
>  x86/pmu_lbr.c |  7 ++-----
>  4 files changed, 21 insertions(+), 9 deletions(-)
> 
> diff --git a/lib/x86/pmu.c b/lib/x86/pmu.c
> index e8b9ae9..35b7efb 100644
> --- a/lib/x86/pmu.c
> +++ b/lib/x86/pmu.c
> @@ -1,8 +1,11 @@
>  #include "pmu.h"
>  
>  struct cpuid cpuid_10;
> +struct pmu_caps pmu;
>  
>  void pmu_init(void)
>  {
>      cpuid_10 = cpuid(10);
> +    if (this_cpu_has(X86_FEATURE_PDCM))
> +        pmu.perf_cap = rdmsr(MSR_IA32_PERF_CAPABILITIES);

Tabs...



[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