From: Avi Kivity Date: Tue, 12 Jun 2012 17:22:28 +0000 (+0300) Subject: KVM: VMX: Improve error reporting during invalid guest state emulation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de5f70e0c65fcd0472a412a7a9690afcd3ee4526;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git KVM: VMX: Improve error reporting during invalid guest state emulation If instruction emulation fails, report it properly to userspace. Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a62f92ab1be..c61eb34a39e 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;