]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
KVM: nVMX: Fix nested_run_pending on activity state HLT
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 4 Jan 2014 17:47:23 +0000 (18:47 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 17 Jan 2014 09:22:17 +0000 (10:22 +0100)
When we suspend the guest in HLT state, the nested run is no longer
pending - we emulated it completely. So only set nested_run_pending
after checking the activity state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c

index fc4a255d542696795c5656a8163925c524c9ce83..f9a54331c8082355f965f6f69c076b5844fe864c 100644 (file)
@@ -8046,8 +8046,6 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
 
        enter_guest_mode(vcpu);
 
-       vmx->nested.nested_run_pending = 1;
-
        vmx->nested.vmcs01_tsc_offset = vmcs_read64(TSC_OFFSET);
 
        cpu = get_cpu();
@@ -8066,6 +8064,8 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
        if (vmcs12->guest_activity_state == GUEST_ACTIVITY_HLT)
                return kvm_emulate_halt(vcpu);
 
+       vmx->nested.nested_run_pending = 1;
+
        /*
         * Note no nested_vmx_succeed or nested_vmx_fail here. At this point
         * we are no longer running L1, and VMLAUNCH/VMRESUME has not yet