commit 36b25ad14fadd5d2966f6935622b58b2bec89a2f
Author: root <root@eddie-wb.localdomain>
Date:   Wed May 13 22:45:40 2009 +0800

    Overwriting former event may help forward progress
    in case of multiple exception/interrupt happens serially.

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d0e75a2..b3de5d2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -183,11 +183,7 @@ static void kvm_multiple_exception(struct kvm_vcpu *vcpu,
 	int class1, class2;
 
 	if (!vcpu->arch.exception.pending) {
-		vcpu->arch.exception.pending = true;
-		vcpu->arch.exception.has_error_code = has_error;
-		vcpu->arch.exception.nr = nr;
-		vcpu->arch.exception.error_code = error_code;
-		return;
+		goto out;
 	}
 
 	/* to check exception */
@@ -208,9 +204,15 @@ static void kvm_multiple_exception(struct kvm_vcpu *vcpu,
 		vcpu->arch.exception.has_error_code = true;
 		vcpu->arch.exception.nr = DF_VECTOR;
 		vcpu->arch.exception.error_code = 0;
+		return;
 	} else
 		printk(KERN_ERR "Exception 0x%x on 0x%x happens serially\n",
 			prev_nr, nr);
+out:
+	vcpu->arch.exception.pending = true;
+	vcpu->arch.exception.has_error_code = has_error;
+	vcpu->arch.exception.nr = nr;
+	vcpu->arch.exception.error_code = error_code;
 }
 
 void kvm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr)
