KVM: x86/pmu: Setup fixed counters' eventsel during PMU initialization
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:24 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:28:02 +0000 (15:28 -0800)
commit61bb2ad795a72a7a75add3ffc257660fd6c7cfea
treec7ef7c4528016fcc84db54d06657a39d4983db26
parentdb9e008a0f37bd31ac3d77d650812612b7c873da
KVM: x86/pmu: Setup fixed counters' eventsel during PMU initialization

Set the eventsel for all fixed counters during PMU initialization, the
eventsel is hardcoded and consumed if and only if the counter is supported,
i.e. there is no reason to redo the setup every time the PMU is refreshed.

Configuring all KVM-supported fixed counter also eliminates a potential
pitfall if/when KVM supports discontiguous fixed counters, in which case
configuring only nr_arch_fixed_counters will be insufficient (ignoring the
fact that KVM will need many other changes to support discontiguous fixed
counters).

Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/pmu_intel.c