kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH kvm/queue v2 0/3] KVM: x86/pmu: Fix out-of-date AMD amd_event_mapping[]
@ 2022-01-17  8:53 Like Xu
  2022-01-17  8:53 ` [PATCH kvm/queue v2 1/3] KVM: x86/pmu: Replace pmu->available_event_types with a new BITMAP Like Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 44+ messages in thread
From: Like Xu @ 2022-01-17  8:53 UTC (permalink / raw)
  To: Paolo Bonzini, Jim Mattson
  Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Joerg Roedel,
	kvm, linux-kernel, Like Xu

The current amd_event_mapping[] named "amd_perfmon_event_map" is only
valid for "K7 and later, up to and including Family 16h" but for AMD
"Family 17h and later", it needs amd_f17h_perfmon_event_mapp[] . 

It's proposed to fix it in a more generic approach:
- decouple the available_event_types from the CPUID 0x0A.EBX bit vector;
- alway get the right perfmon_event_map[] form the hoser perf interface;
- dynamically populate {inte|amd}_event_mapping[] during hardware setup;

v1 -> v2 Changelog:
- Drop some merged patches and one misunderstood patch;
- Rename bitmap name from "avail_cpuid_events" to "avail_perf_hw_ids";
- Fix kernel test robot() compiler warning;

Previous:
https://lore.kernel.org/kvm/20211112095139.21775-1-likexu@tencent.com/

Like Xu (3):
  KVM: x86/pmu: Replace pmu->available_event_types with a new BITMAP
  perf: x86/core: Add interface to query perfmon_event_map[] directly
  KVM: x86/pmu: Setup the {inte|amd}_event_mapping[] when hardware_setup

 arch/x86/events/core.c            |  9 ++++
 arch/x86/include/asm/kvm_host.h   |  2 +-
 arch/x86/include/asm/perf_event.h |  2 +
 arch/x86/kvm/pmu.c                | 25 ++++++++++-
 arch/x86/kvm/pmu.h                |  2 +
 arch/x86/kvm/svm/pmu.c            | 23 ++--------
 arch/x86/kvm/vmx/pmu_intel.c      | 72 ++++++++++++++++++++-----------
 arch/x86/kvm/x86.c                |  1 +
 8 files changed, 89 insertions(+), 47 deletions(-)

-- 
2.33.1


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2022-02-16 18:10 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  8:53 [PATCH kvm/queue v2 0/3] KVM: x86/pmu: Fix out-of-date AMD amd_event_mapping[] Like Xu
2022-01-17  8:53 ` [PATCH kvm/queue v2 1/3] KVM: x86/pmu: Replace pmu->available_event_types with a new BITMAP Like Xu
2022-02-01 12:26   ` Paolo Bonzini
2022-01-17  8:53 ` [PATCH kvm/queue v2 2/3] perf: x86/core: Add interface to query perfmon_event_map[] directly Like Xu
2022-02-01 12:27   ` Paolo Bonzini
2022-02-02 14:43   ` Peter Zijlstra
2022-02-02 22:35     ` Jim Mattson
2022-02-03 17:33       ` David Dunn
2022-02-09  8:10       ` KVM: x86: Reconsider the current approach of vPMU Like Xu
2022-02-09 13:33         ` Peter Zijlstra
2022-02-09 21:00           ` Sean Christopherson
2022-02-10 12:08             ` Like Xu
2022-02-10 17:12               ` Sean Christopherson
2022-02-16  3:33                 ` Like Xu
2022-02-16 17:53                   ` Jim Mattson
2022-02-09 13:21       ` [PATCH kvm/queue v2 2/3] perf: x86/core: Add interface to query perfmon_event_map[] directly Peter Zijlstra
2022-02-09 15:40         ` Dave Hansen
2022-02-09 18:47           ` Jim Mattson
2022-02-09 18:57             ` Dave Hansen
2022-02-09 19:24               ` David Dunn
2022-02-10 13:29                 ` Like Xu
2022-02-10 15:34                 ` Liang, Kan
2022-02-10 16:34                   ` Jim Mattson
2022-02-10 18:30                     ` Liang, Kan
2022-02-10 19:16                       ` Jim Mattson
2022-02-10 19:46                         ` Liang, Kan
2022-02-10 19:55                           ` David Dunn
2022-02-11 14:11                             ` Liang, Kan
2022-02-11 18:08                               ` Jim Mattson
2022-02-11 21:47                                 ` Liang, Kan
2022-02-12 23:31                                   ` Jim Mattson
2022-02-14 21:55                                     ` Liang, Kan
2022-02-14 22:55                                       ` Jim Mattson
2022-02-16  7:36                                         ` Like Xu
2022-02-16 18:10                                           ` Jim Mattson
2022-02-16  7:30                           ` Like Xu
2022-02-16  5:08                   ` Like Xu
2022-02-10 12:55               ` Like Xu
2022-02-12 23:32               ` Jim Mattson
2022-02-08 11:52     ` Like Xu
2022-01-17  8:53 ` [PATCH kvm/queue v2 3/3] KVM: x86/pmu: Setup the {inte|amd}_event_mapping[] when hardware_setup Like Xu
2022-02-01 12:28   ` Paolo Bonzini
2022-02-08 10:10     ` Like Xu
2022-01-26 11:22 ` [PATCH kvm/queue v2 0/3] KVM: x86/pmu: Fix out-of-date AMD amd_event_mapping[] Like Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).