> That is OK, You can send two patches. The first one will WARN_ON and
> overwrite exception like the current code does. And the second one
> will remove WARN_ON explaining that this case is actually possible to
> trigger from a guest.
> 
Sounds you don't like to provide this additional one, here it is for the 
purpose of
removing the block issue. My basic position is still same with what mentioned 
in previous mail, but I am neutral to either way.

Thx, eddie

Signed-off-by: Eddie Dong <[email protected]>

    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)

Attachment: serial_irq.patch
Description: serial_irq.patch

Reply via email to