Message ID | 1251470933-14500-2-git-send-email-m.gamal005@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Aug 28, 2009 at 04:48:53PM +0200, Mohammed Gamal wrote: > Since we return to userspace from KVM on invalid state emulation failure, let > qemu handle it. > > Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> > --- > qemu-kvm.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/qemu-kvm.c b/qemu-kvm.c > index b59e403..a1648e0 100644 > --- a/qemu-kvm.c > +++ b/qemu-kvm.c > @@ -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: > + kvm_show_regs(vcpu); > + fprintf(stderr, "\nKVM internal error. Suberror: %d\n", > + run->internal.suberror); > + 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); > -- > 1.6.0.4 The common practice is to print msg first and then kvm_show_regs? Applied the kvm.h update, thanks. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Sep 1, 2009 at 2:31 PM, Marcelo Tosatti<mtosatti@redhat.com> wrote: > On Fri, Aug 28, 2009 at 04:48:53PM +0200, Mohammed Gamal wrote: >> Since we return to userspace from KVM on invalid state emulation failure, let >> qemu handle it. >> >> Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> >> --- >> Â qemu-kvm.c | Â Â 8 ++++++++ >> Â 1 files changed, 8 insertions(+), 0 deletions(-) >> >> diff --git a/qemu-kvm.c b/qemu-kvm.c >> index b59e403..a1648e0 100644 >> --- a/qemu-kvm.c >> +++ b/qemu-kvm.c >> @@ -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: >> + Â Â Â Â kvm_show_regs(vcpu); >> + Â Â Â Â fprintf(stderr, "\nKVM internal error. Suberror: %d\n", >> + Â Â Â Â Â Â Â Â run->internal.suberror); >> + Â Â Â Â 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); >> -- >> 1.6.0.4 > > The common practice is to print msg first and then kvm_show_regs? True. I just thought the message would be more visible this way. Will resend > Applied the kvm.h update, thanks. > > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/qemu-kvm.c b/qemu-kvm.c index b59e403..a1648e0 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -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: + kvm_show_regs(vcpu); + fprintf(stderr, "\nKVM internal error. Suberror: %d\n", + run->internal.suberror); + 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);
Since we return to userspace from KVM on invalid state emulation failure, let qemu handle it. Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> --- qemu-kvm.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)