summaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-05-03 15:49:19 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2010-05-03 15:49:19 -0300
commitbab679f32c0090d3c1bc1ec590bf47ca7ae2c987 (patch)
treec1946634542f0b361fcea5594604bb812dbe63af /kvm-all.c
parentca7fbd37657670ce1000edb908ec9f2ace6a9291 (diff)
parent7c80eef899ff0feb1ab6730d4dd3bc3aee046093 (diff)
Merge commit '7c80eef899ff0feb1ab6730d4dd3bc3aee046093' into upstream-merge
* commit '7c80eef899ff0feb1ab6730d4dd3bc3aee046093': kvm: handle internal error target-i386: print EFER in cpu_dump_state Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 99d4aded3..a9d0a8619 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -746,6 +746,32 @@ static int kvm_handle_io(uint16_t port, void *data, int direction, int size,
return 1;
}
+#ifdef KVM_CAP_INTERNAL_ERROR_DATA
+static void kvm_handle_internal_error(CPUState *env, struct kvm_run *run)
+{
+
+ if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {
+ int i;
+
+ fprintf(stderr, "KVM internal error. Suberror: %d\n",
+ run->internal.suberror);
+
+ for (i = 0; i < run->internal.ndata; ++i) {
+ fprintf(stderr, "extra data[%d]: %"PRIx64"\n",
+ i, (uint64_t)run->internal.data[i]);
+ }
+ }
+ cpu_dump_state(env, stderr, fprintf, 0);
+ if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) {
+ fprintf(stderr, "emulation failure\n");
+ }
+ /* FIXME: Should trigger a qmp message to let management know
+ * something went wrong.
+ */
+ vm_stop(0);
+}
+#endif
+
void kvm_flush_coalesced_mmio_buffer(void)
{
#ifdef KVM_CAP_COALESCED_MMIO
@@ -863,6 +889,11 @@ int kvm_cpu_exec(CPUState *env)
case KVM_EXIT_EXCEPTION:
DPRINTF("kvm_exit_exception\n");
break;
+#ifdef KVM_CAP_INTERNAL_ERROR_DATA
+ case KVM_EXIT_INTERNAL_ERROR:
+ kvm_handle_internal_error(env, run);
+ break;
+#endif
case KVM_EXIT_DEBUG:
DPRINTF("kvm_exit_debug\n");
#ifdef KVM_CAP_SET_GUEST_DEBUG