]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Copy kvm_pmu_ops by value to eliminate layer of indirection
authorLike Xu <likexu@tencent.com>
Tue, 29 Mar 2022 23:50:52 +0000 (23:50 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 Apr 2022 17:37:44 +0000 (13:37 -0400)
commit465ed69dd36d1f445e6f05c8185948633074c216
treee7457b30c3e0ab944bc31a50cfea800a496458d3
parent6f240dedfc13706043ffc753c57f2784e4ce4bbc
KVM: x86: Copy kvm_pmu_ops by value to eliminate layer of indirection

Replace the kvm_pmu_ops pointer in common x86 with an instance of the
struct to save one pointer dereference when invoking functions. Copy the
struct by value to set the ops during kvm_init().

Signed-off-by: Like Xu <likexu@tencent.com>
[sean: Move pmc_is_enabled(), make kvm_pmu_ops static]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220329235054.3534728-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.c
arch/x86/kvm/pmu.h
arch/x86/kvm/x86.c