KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id()
authorLike Xu <likexu@tencent.com>
Tue, 30 Nov 2021 07:42:17 +0000 (15:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 May 2022 17:54:47 +0000 (19:54 +0200)
commit29afcd5af012ef6cc8f49b15cf79b6061f36084b
tree34bfbb7d3c321d7eed21cf040c2b19c18c13252d
parentea65a7d76c00b231fc114e58d2cae1d918dd425c
KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id()

commit 7c174f305cbee6bdba5018aae02b84369e7ab995 upstream.

The find_arch_event() returns a "unsigned int" value,
which is used by the pmc_reprogram_counter() to
program a PERF_TYPE_HARDWARE type perf_event.

The returned value is actually the kernel defined generic
perf_hw_id, let's rename it to pmc_perf_hw_id() with simpler
incoming parameters for better self-explanation.

Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20211130074221.93635-3-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Backport to 5.4: kvm_x86_ops is a pointer here]
Signed-off-by: Kyle Huey <me@kylehuey.com>]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/pmu.c
arch/x86/kvm/pmu.h
arch/x86/kvm/pmu_amd.c
arch/x86/kvm/vmx/pmu_intel.c