summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-06-12 20:22:28 +0300
committerAvi Kivity <avi@redhat.com>2012-07-09 14:19:04 +0300
commitde5f70e0c65fcd0472a412a7a9690afcd3ee4526 (patch)
tree5b5bd6482e5731a5209b46820104021310efbb48 /arch/x86/kvm/vmx.c
parentde87dcddc70ec6a90adfcc81f0ad7d84a892ffce (diff)
downloadblackbird-op-linux-de5f70e0c65fcd0472a412a7a9690afcd3ee4526.tar.gz
blackbird-op-linux-de5f70e0c65fcd0472a412a7a9690afcd3ee4526.zip
KVM: VMX: Improve error reporting during invalid guest state emulation
If instruction emulation fails, report it properly to userspace. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a62f92ab1be2..c61eb34a39e7 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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;
OpenPOWER on IntegriCloud