From: Nadav Amit Date: Sun, 2 Nov 2014 09:54:42 +0000 (+0200) Subject: KVM: x86: No error-code on real-mode exceptions X-Git-Tag: firefly_0821_release~176^2~2635^2~87 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3ffb24681cc46f869378a4de54615db8d4ef0daf;p=firefly-linux-kernel-4.4.55.git KVM: x86: No error-code on real-mode exceptions 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 Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 14c49cf3f77f..e8850295031f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -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;