Skip to content

Commit

Permalink
KVM: VMX: Improve error reporting during invalid guest state emulation
Browse files Browse the repository at this point in the history
If instruction emulation fails, report it properly to userspace.

Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Avi Kivity committed Jul 9, 2012
1 parent de87dcd commit de5f70e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4996,8 +4996,12 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)
goto out;
}

if (err != EMULATE_DONE)
if (err != EMULATE_DONE) {
vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
vcpu->run->internal.ndata = 0;
return 0;
}

if (signal_pending(current))
goto out;
Expand Down

0 comments on commit de5f70e

Please sign in to comment.