OSDN Git Service

KVM: x86/pmu: Reuse pmc_perf_hw_id() and drop find_fixed_event()
authorLike Xu <likexu@tencent.com>
Tue, 30 Nov 2021 07:42:18 +0000 (15:42 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 Jan 2022 15:44:42 +0000 (10:44 -0500)
commit6ed1298eb0bf6641b0a66c2c38369f5767a2575c
tree8252add2eb57b52fa72f8a7ccabec5ee9e9f6741
parent7c174f305cbee6bdba5018aae02b84369e7ab995
KVM: x86/pmu: Reuse pmc_perf_hw_id() and drop find_fixed_event()

Since we set the same semantic event value for the fixed counter in
pmc->eventsel, returning the perf_hw_id for the fixed counter via
find_fixed_event() can be painlessly replaced by pmc_perf_hw_id()
with the help of pmc_is_fixed() check.

Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20211130074221.93635-4-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.c
arch/x86/kvm/pmu.h
arch/x86/kvm/svm/pmu.c
arch/x86/kvm/vmx/pmu_intel.c