]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: nVMX: Track vmcs12 offsets for shadowed VMCS fields
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 7 May 2019 15:36:25 +0000 (08:36 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 18 Jun 2019 09:46:05 +0000 (11:46 +0200)
commit1c6f0b47fb59d1674a6ba91b0ce58dfbfc5a76de
tree8b49f1048d142dacb2f57327ec1a2dbf605b44ad
parentb643780562af5378ef7fe731c65b8f93e49c59c6
KVM: nVMX: Track vmcs12 offsets for shadowed VMCS fields

The vmcs12 fields offsets are constant and known at compile time.  Store
the associated offset for each shadowed field to avoid the costly lookup
in vmcs_field_to_offset() when copying between vmcs12 and the shadow
VMCS.  Avoiding the costly lookup reduces the latency of copying by
~100 cycles in each direction.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmcs12.h
arch/x86/kvm/vmx/vmcs_shadow_fields.h