Skip to content

Commit ec61b23

Browse files
committed
KVM: x86/pmu: Remove manual clearing of fields in kvm_pmu_init()
Remove code that unnecessarily clears event_count and need_cleanup in kvm_pmu_init(), the entire kvm_pmu is zeroed just a few lines earlier. Vendor code doesn't set event_count or need_cleanup during .init(), and if either VMX or SVM did set those fields it would be a flagrant bug. Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://lore.kernel.org/r/20231103230541.352265-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent f2f63f7 commit ec61b23

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

arch/x86/kvm/pmu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,6 @@ void kvm_pmu_init(struct kvm_vcpu *vcpu)
710710

711711
memset(pmu, 0, sizeof(*pmu));
712712
static_call(kvm_x86_pmu_init)(vcpu);
713-
pmu->event_count = 0;
714-
pmu->need_cleanup = false;
715713
kvm_pmu_refresh(vcpu);
716714
}
717715

0 commit comments

Comments
 (0)