[0/4] KVM: x86/pmu: Clean up arch/hw event handling

Message ID 20230607010206.1425277-1-seanjc@google.com
Headers
Series KVM: x86/pmu: Clean up arch/hw event handling |

Message

Sean Christopherson June 7, 2023, 1:02 a.m. UTC
  Clean up KVM's handling of arch/hw events, and the related fixed counter
usage.  KVM has far too many open coded magic numbers, and kludgy code
that stems from the magic numbers.

Sean Christopherson (4):
  KVM: x86/pmu: Use enums instead of hardcoded magic for arch event
    indices
  KVM: x86/pmu: Simplify intel_hw_event_available()
  KVM: x86/pmu: Require nr fixed_pmc_events to match nr max fixed
    counters
  KVM: x86/pmu: Move .hw_event_available() check out of PMC filter
    helper

 arch/x86/kvm/pmu.c           |  4 +-
 arch/x86/kvm/vmx/pmu_intel.c | 81 ++++++++++++++++++++++++------------
 2 files changed, 56 insertions(+), 29 deletions(-)


base-commit: 31b4fc3bc64aadd660c5bfa5178c86a7ba61e0f7
  

Comments

Sean Christopherson Aug. 3, 2023, 12:05 a.m. UTC | #1
On Tue, 06 Jun 2023 18:02:02 -0700, Sean Christopherson wrote:
> Clean up KVM's handling of arch/hw events, and the related fixed counter
> usage.  KVM has far too many open coded magic numbers, and kludgy code
> that stems from the magic numbers.
> 
> Sean Christopherson (4):
>   KVM: x86/pmu: Use enums instead of hardcoded magic for arch event
>     indices
>   KVM: x86/pmu: Simplify intel_hw_event_available()
>   KVM: x86/pmu: Require nr fixed_pmc_events to match nr max fixed
>     counters
>   KVM: x86/pmu: Move .hw_event_available() check out of PMC filter
>     helper
> 
> [...]

Applied to kvm-x86 pmu, thanks!

[1/4] KVM: x86/pmu: Use enums instead of hardcoded magic for arch event indices
      https://github.com/kvm-x86/linux/commit/0033fa354916
[2/4] KVM: x86/pmu: Simplify intel_hw_event_available()
      https://github.com/kvm-x86/linux/commit/bc9658999b3e
[3/4] KVM: x86/pmu: Require nr fixed_pmc_events to match nr max fixed counters
      https://github.com/kvm-x86/linux/commit/6d88d0ee5de1
[4/4] KVM: x86/pmu: Move .hw_event_available() check out of PMC filter helper
      https://github.com/kvm-x86/linux/commit/6de2ccc16968

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes