Messages in this thread Patch in this message | | | From | Like Xu <> | Subject | [PATCH v2 1/7] KVM: x86: Export kvm_pmu_is_valid_msr() for nVMX | Date | Mon, 8 Nov 2021 19:10:26 +0800 |
| |
From: Like Xu <likexu@tencent.com>
Let's export kvm_pmu_is_valid_msr() for nVMX, instead of exporting all kvm_pmu_ops for this one case. The reduced access scope will help to optimize the kvm_x86_ops.pmu_ops stuff later.
Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Like Xu <likexu@tencent.com> --- arch/x86/kvm/pmu.c | 1 + arch/x86/kvm/vmx/nested.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index 0772bad9165c..aa6ac9c7aff2 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -398,6 +398,7 @@ bool kvm_pmu_is_valid_msr(struct kvm_vcpu *vcpu, u32 msr) return kvm_x86_ops.pmu_ops->msr_idx_to_pmc(vcpu, msr) || kvm_x86_ops.pmu_ops->is_valid_msr(vcpu, msr); } +EXPORT_SYMBOL_GPL(kvm_pmu_is_valid_msr); static void kvm_pmu_mark_pmc_in_use(struct kvm_vcpu *vcpu, u32 msr) { diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index b4ee5e9f9e20..6c6bc8b2072a 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -4796,7 +4796,7 @@ void nested_vmx_pmu_entry_exit_ctls_update(struct kvm_vcpu *vcpu) return; vmx = to_vmx(vcpu); - if (kvm_x86_ops.pmu_ops->is_valid_msr(vcpu, MSR_CORE_PERF_GLOBAL_CTRL)) { + if (kvm_pmu_is_valid_msr(vcpu, MSR_CORE_PERF_GLOBAL_CTRL)) { vmx->nested.msrs.entry_ctls_high |= VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL; vmx->nested.msrs.exit_ctls_high |= -- 2.33.0
| |