KVM: x86/pmu: Simplify intel_hw_event_available()
authorSean Christopherson <seanjc@google.com>
Wed, 7 Jun 2023 01:02:04 +0000 (18:02 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 2 Aug 2023 23:44:36 +0000 (16:44 -0700)
commitbc9658999b3e44cbad964fe9fbab5a25bd4f5ed3
tree2c6de5a5bea58f5bc9791ae1f1b980daaf451590
parent0033fa35491680bce65ff78fb41445f472aa5baa
KVM: x86/pmu: Simplify intel_hw_event_available()

Walk only the "real", i.e. non-pseudo, architectural events when checking
if a hardware event is available, i.e. isn't disabled by guest CPUID.
Skipping pseudo-arch events in the loop body is unnecessarily convoluted,
especially now that KVM has enums that delineate between real and pseudo
events.

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