Skip to content

Commit 58baa64

Browse files
committed
KVM: x86/pmu: Drop redundant check on PMC being globally enabled for emulation
When triggering PMC events in response to emulation, drop the redundant checks on a PMC being globally and locally enabled, as the passed in bitmap contains only PMCs that are locally enabled (and counting the right event), and the local copy of the bitmap has already been masked with global_ctrl. No true functional change intended. Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://lore.kernel.org/r/20250805190526.1453366-15-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent e630bb5 commit 58baa64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ static void kvm_pmu_trigger_event(struct kvm_vcpu *vcpu,
974974
return;
975975

976976
kvm_for_each_pmc(pmu, pmc, i, bitmap) {
977-
if (!pmc_is_globally_enabled(pmc) || !pmc_is_locally_enabled(pmc) ||
977+
if (!pmc_is_locally_enabled(pmc) ||
978978
!check_pmu_event_filter(pmc) || !cpl_is_matched(pmc))
979979
continue;
980980

0 commit comments

Comments
 (0)