diff options
author | Lai Jiangshan <laijs@linux.alibaba.com> | 2021-11-24 15:20:45 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-12-08 12:25:11 +0300 |
commit | c59a0f57fa32cfa77643daa17a8e55377cc9fe0b (patch) | |
tree | f5be62c8c6af8bc3ed1cdf928090d23b6c6a8a9d /arch/x86/kvm/mmu.h | |
parent | 1f5a21ee8400ccc82c67dc8c153301f694a04099 (diff) | |
download | linux-c59a0f57fa32cfa77643daa17a8e55377cc9fe0b.tar.xz |
KVM: X86: Remove mmu->translate_gpa
Reduce an indirect function call (retpoline) and some intialization
code.
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20211124122055.64424-4-jiangshanlai@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.h')
-rw-r--r-- | arch/x86/kvm/mmu.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index 9ae6168d381e..97e13c2988b3 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h @@ -351,4 +351,17 @@ static inline void kvm_update_page_stats(struct kvm *kvm, int level, int count) { atomic64_add(count, &kvm->stat.pages[level - 1]); } + +gpa_t translate_nested_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access, + struct x86_exception *exception); + +static inline gpa_t kvm_translate_gpa(struct kvm_vcpu *vcpu, + struct kvm_mmu *mmu, + gpa_t gpa, u32 access, + struct x86_exception *exception) +{ + if (mmu != &vcpu->arch.nested_mmu) + return gpa; + return translate_nested_gpa(vcpu, gpa, access, exception); +} #endif |