diff mbox series

kvm: x86: #DF only has an error code in protected mode

Message ID 20181012170553.209685-1-jmattson@google.com (mailing list archive)
State New, archived
Headers show
Series kvm: x86: #DF only has an error code in protected mode | expand

Commit Message

Jim Mattson Oct. 12, 2018, 5:05 p.m. UTC
Exceptions do not have error codes in real-address mode.

Fixes: 3fd28fce76563 ("KVM: x86: make double/triple fault promotion generic to all exceptions")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Christopherson Oct. 12, 2018, 5:19 p.m. UTC | #1
On Fri, Oct 12, 2018 at 10:05:53AM -0700, Jim Mattson wrote:
> Exceptions do not have error codes in real-address mode.
> 
> Fixes: 3fd28fce76563 ("KVM: x86: make double/triple fault promotion generic to all exceptions")
> Signed-off-by: Jim Mattson <jmattson@google.com>

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
diff mbox series

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ca717737347e..4ab569171ad1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -452,7 +452,7 @@  static void kvm_multiple_exception(struct kvm_vcpu *vcpu,
 		 */
 		vcpu->arch.exception.pending = true;
 		vcpu->arch.exception.injected = false;
-		vcpu->arch.exception.has_error_code = true;
+		vcpu->arch.exception.has_error_code = is_protmode(vcpu);
 		vcpu->arch.exception.nr = DF_VECTOR;
 		vcpu->arch.exception.error_code = 0;
 	} else