KVM: VMX: Add proper cache tracking for CR4
Move CR4 caching into the standard register caching mechanism in order to take advantage of the availability checks provided by regs_avail. This avoids multiple VMREADs and retpolines (when configured) during nested VMX transitions as kvm_read_cr4_bits() is invoked multiple times on each transition, e.g. when stuffing CR0 and CR3. As an added bonus, this eliminates a kvm_x86_ops hook, saves a retpoline on SVM when reading CR4, and squashes the confusing naming discrepancy of "cache_reg" vs. "decache_cr4_guest_bits". No functional change intended. Signed-off-by:Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200502043234.12481-7-sean.j.christopherson@intel.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- arch/x86/include/asm/kvm_host.h 1 addition, 1 deletionarch/x86/include/asm/kvm_host.h
- arch/x86/kvm/kvm_cache_regs.h 3 additions, 2 deletionsarch/x86/kvm/kvm_cache_regs.h
- arch/x86/kvm/svm/svm.c 0 additions, 5 deletionsarch/x86/kvm/svm/svm.c
- arch/x86/kvm/vmx/vmx.c 9 additions, 9 deletionsarch/x86/kvm/vmx/vmx.c
- arch/x86/kvm/vmx/vmx.h 1 addition, 0 deletionsarch/x86/kvm/vmx/vmx.h
Loading
Please register or sign in to comment