]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/pmu: Replace pmc_perf_hw_id() with perf_get_hw_event_config()
authorLike Xu <likexu@tencent.com>
Wed, 18 May 2022 13:25:11 +0000 (21:25 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jun 2022 08:49:03 +0000 (04:49 -0400)
commit4028c5c9aeb121cde8e22fa8dba22b45fd13c517
tree6ba8ca23d18dff539be88b5044138a8cdb62b968
parentb3e7776f6a226546bb7be8a92b838d487edda4f0
KVM: x86/pmu: Replace pmc_perf_hw_id() with perf_get_hw_event_config()

With the help of perf_get_hw_event_config(), KVM could query the correct
EVENTSEL_{EVENT, UMASK} pair of a kernel-generic hw event directly from
the different *_perfmon_event_map[] by the kernel's pre-defined perf_hw_id.

Also extend the bit range of the comparison field to
AMD64_RAW_EVENT_MASK_NB to prevent AMD from
defining EventSelect[11:8] into perfmon_event_map[] one day.

Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20220518132512.37864-11-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.c