KVM: x86: Copy kvm_x86_ops by value to eliminate layer of indirection
Replace the kvm_x86_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(). Arbitrarily use kvm_x86_ops.hardware_enable to track whether or not the ops have been initialized, i.e. a vendor KVM module has been loaded. Suggested-by:Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200321202603.19355-7-sean.j.christopherson@intel.com> Reviewed-by:
Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- arch/x86/include/asm/kvm_host.h 9 additions, 9 deletionsarch/x86/include/asm/kvm_host.h
- arch/x86/kvm/cpuid.c 2 additions, 2 deletionsarch/x86/kvm/cpuid.c
- arch/x86/kvm/hyperv.c 4 additions, 4 deletionsarch/x86/kvm/hyperv.c
- arch/x86/kvm/kvm_cache_regs.h 5 additions, 5 deletionsarch/x86/kvm/kvm_cache_regs.h
- arch/x86/kvm/lapic.c 15 additions, 15 deletionsarch/x86/kvm/lapic.c
- arch/x86/kvm/mmu.h 4 additions, 4 deletionsarch/x86/kvm/mmu.h
- arch/x86/kvm/mmu/mmu.c 16 additions, 16 deletionsarch/x86/kvm/mmu/mmu.c
- arch/x86/kvm/pmu.c 15 additions, 15 deletionsarch/x86/kvm/pmu.c
- arch/x86/kvm/pmu.h 1 addition, 1 deletionarch/x86/kvm/pmu.h
- arch/x86/kvm/svm.c 1 addition, 1 deletionarch/x86/kvm/svm.c
- arch/x86/kvm/trace.h 2 additions, 2 deletionsarch/x86/kvm/trace.h
- arch/x86/kvm/vmx/nested.c 1 addition, 1 deletionarch/x86/kvm/vmx/nested.c
- arch/x86/kvm/vmx/vmx.c 2 additions, 2 deletionsarch/x86/kvm/vmx/vmx.c
- arch/x86/kvm/x86.c 178 additions, 178 deletionsarch/x86/kvm/x86.c
- arch/x86/kvm/x86.h 2 additions, 2 deletionsarch/x86/kvm/x86.h
Loading
Please register or sign in to comment