Skip to contentSkip to conversation

Handle emulation failure in userspace

PATCH Applied Mohammed Gamal 2 participants 2 messages Sep 1, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Handle emulation failure in userspace

Since we return to userspace from KVM on invalid state emulation failure, let qemu handle it.

---
 qemu-kvm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
qemu-kvm.c +8 -0
index b59e403..090a3ae 100644
@@ -1029,6 +1029,14 @@ int kvm_run(kvm_vcpu_context_t vcpu, void *env)
             r = kvm_s390_handle_reset(kvm, vcpu, run);
             break;
 #endif
+	case KVM_EXIT_INTERNAL_ERROR:
+	    fprintf(stderr, "KVM internal error. Suberror: %d\n",
+		    run->internal.suberror);
+	    kvm_show_regs(vcpu);
+	    if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION)
+		fprintf(stderr, "emulation failure, check dmesg for details\n");
+	    abort();
+	    break;
         default:
             if (kvm_arch_run(vcpu)) {
                 fprintf(stderr, "unhandled vm exit: 0x%x\n", run->exit_reason);
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 2 lines · Mohammed Gamal

Since we return to userspace from KVM on invalid state emulation failure, let qemu handle it.

Applied, thanks.