KVM: x86: No error-code on real-mode exceptions
authorNadav Amit <namit@cs.technion.ac.il>
Sun, 2 Nov 2014 09:54:42 +0000 (11:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 Nov 2014 14:44:02 +0000 (15:44 +0100)
Real-mode exceptions do not deliver error code. As can be seen in Intel SDM
volume 2, real-mode exceptions do not have parentheses, which indicate
error-code.  To avoid significant changes of the code, the error code is
"removed" during exception queueing.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index 14c49cf3f77f07967e4950d614965caf80ab7e90..e8850295031fcd9a48c1442658cd7c308cd349e5 100644 (file)
@@ -353,6 +353,8 @@ static void kvm_multiple_exception(struct kvm_vcpu *vcpu,
 
        if (!vcpu->arch.exception.pending) {
        queue:
+               if (has_error && !is_protmode(vcpu))
+                       has_error = false;
                vcpu->arch.exception.pending = true;
                vcpu->arch.exception.has_error_code = has_error;
                vcpu->arch.exception.nr = nr;