KVM: x86/pmu: Add macros to iterate over all PMCs given a bitmap
authorSean Christopherson <seanjc@google.com>
Fri, 10 Nov 2023 02:28:52 +0000 (18:28 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 1 Feb 2024 17:35:48 +0000 (09:35 -0800)
commite5a65d4f723ab9997deab798c539e6bfd71f8440
treec8ad383b1b4c18509af87f9aea4e66133a372067
parent004a0aa56edea3effc97bc90a620da1bcde5c63c
KVM: x86/pmu: Add macros to iterate over all PMCs given a bitmap

Add and use kvm_for_each_pmc() to dedup a variety of open coded for-loops
that iterate over valid PMCs given a bitmap (and because seeing checkpatch
whine about bad macro style is always amusing).

No functional change intended.

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