KVM: x86/pmu: Move .hw_event_available() check out of PMC filter helper
authorSean Christopherson <seanjc@google.com>
Wed, 7 Jun 2023 01:02:06 +0000 (18:02 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 2 Aug 2023 23:44:36 +0000 (16:44 -0700)
commit6de2ccc169683bf81feba163834dae7cdebdd826
tree23bbbc553a6b35d1336346e0f4fba89a787a576b
parent6d88d0ee5de142921598e5c0041792bbd860913d
KVM: x86/pmu: Move .hw_event_available() check out of PMC filter helper

Move the call to kvm_x86_pmu.hw_event_available(), which has nothing to
with the userspace PMU filter, out of check_pmu_event_filter() and into
its sole caller pmc_event_is_allowed().  pmc_event_is_allowed() didn't
exist when commit 7aadaa988c5e ("KVM: x86/pmu: Drop amd_event_mapping[]
in the KVM context"), so presumably the motivation for invoking
.hw_event_available() from check_pmu_event_filter() was to avoid having
to add multiple call sites.

Link: https://lore.kernel.org/r/20230607010206.1425277-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/pmu.c