KVM: VMX: Re-enter guest in fastpath for "spurious" preemption timer exits
[linux-2.6-microblaze.git] / arch / x86 / kvm / vmx / vmx.c
index e3653d1..a44b09e 100644 (file)
@@ -5992,8 +5992,15 @@ static fastpath_t handle_fastpath_preemption_timer(struct kvm_vcpu *vcpu)
 {
        struct vcpu_vmx *vmx = to_vmx(vcpu);
 
-       if (!vmx->req_immediate_exit &&
-           !unlikely(vmx->loaded_vmcs->hv_timer_soft_disabled)) {
+       /*
+        * In the *extremely* unlikely scenario that this is a spurious VM-Exit
+        * due to the timer expiring while it was "soft" disabled, just eat the
+        * exit and re-enter the guest.
+        */
+       if (unlikely(vmx->loaded_vmcs->hv_timer_soft_disabled))
+               return EXIT_FASTPATH_REENTER_GUEST;
+
+       if (!vmx->req_immediate_exit) {
                kvm_lapic_expired_hv_timer(vcpu);
                return EXIT_FASTPATH_REENTER_GUEST;
        }