diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2019-05-07 15:17:55 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-06-18 05:47:41 -0400 |
commit | c5f2c76643b612ffa47e4660c8f44deba619b068 (patch) | |
tree | d4893e980f629441b857ef9e4877e14ec0617198 /arch/x86/kvm/vmx/nested.c | |
parent | 70f932ecdfe6b593ef6784d55d2c096aafac1510 (diff) |
KVM: VMX: Shadow VMCS pin controls
Prepare to shadow all major control fields on a per-VMCS basis, which
allows KVM to avoid costly VMWRITEs when switching between vmcs01 and
vmcs02.
Shadowing pin controls also allows a future patch to remove the per-VMCS
'hv_timer_armed' flag, as the shadow copy is a superset of said flag.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/nested.c')
-rw-r--r-- | arch/x86/kvm/vmx/nested.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index cd33f3109f24..8617d305fbbd 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c | |||
@@ -285,6 +285,7 @@ static void vmx_switch_vmcs(struct kvm_vcpu *vcpu, struct loaded_vmcs *vmcs) | |||
285 | 285 | ||
286 | vm_entry_controls_reset_shadow(vmx); | 286 | vm_entry_controls_reset_shadow(vmx); |
287 | vm_exit_controls_reset_shadow(vmx); | 287 | vm_exit_controls_reset_shadow(vmx); |
288 | pin_controls_reset_shadow(vmx); | ||
288 | vmx_segment_cache_clear(vmx); | 289 | vmx_segment_cache_clear(vmx); |
289 | } | 290 | } |
290 | 291 | ||
@@ -2026,7 +2027,7 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12) | |||
2026 | } else { | 2027 | } else { |
2027 | exec_control &= ~PIN_BASED_POSTED_INTR; | 2028 | exec_control &= ~PIN_BASED_POSTED_INTR; |
2028 | } | 2029 | } |
2029 | vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, exec_control); | 2030 | pin_controls_init(vmx, exec_control); |
2030 | 2031 | ||
2031 | /* | 2032 | /* |
2032 | * EXEC CONTROLS | 2033 | * EXEC CONTROLS |