aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-07-28 11:31:06 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-29 03:04:22 -0400
commit63fbf59f8a31548e64cdc3adc5d0997be0486b27 (patch)
tree4f9325564fea52b19c798724f67497d5c64e8c6a
parentbf640876e21fe603f7f52b0c27d66b7716da0384 (diff)
nVMX: reset rflags register cache during nested vmentry.
During nested vmentry into vm86 mode a vcpu state is found to be incorrect because rflags does not have VM flag set since it is read from the cache and has L1's value instead of L2's. If emulate_invalid_guest_state=1 L0 KVM tries to emulate it, but emulation does not work for nVMX and it never should happen anyway. Fix that by using vmx_set_rflags() to set rflags during nested vmentry which takes care of updating register cache. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 45fd70cef88e..c143f4087d19 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7409,7 +7409,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7409 vmcs12->guest_interruptibility_info); 7409 vmcs12->guest_interruptibility_info);
7410 vmcs_write32(GUEST_SYSENTER_CS, vmcs12->guest_sysenter_cs); 7410 vmcs_write32(GUEST_SYSENTER_CS, vmcs12->guest_sysenter_cs);
7411 kvm_set_dr(vcpu, 7, vmcs12->guest_dr7); 7411 kvm_set_dr(vcpu, 7, vmcs12->guest_dr7);
7412 vmcs_writel(GUEST_RFLAGS, vmcs12->guest_rflags); 7412 vmx_set_rflags(vcpu, vmcs12->guest_rflags);
7413 vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS, 7413 vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS,
7414 vmcs12->guest_pending_dbg_exceptions); 7414 vmcs12->guest_pending_dbg_exceptions);
7415 vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->guest_sysenter_esp); 7415 vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->guest_sysenter_esp);