aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-26 19:54:36 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-26 19:54:36 +0000
commitf55761a0c46583f4faf1d7595f4f41b35b15508b (patch)
tree1acef3bff9ad2156ca99a1f662cbc0f39251c6ce
parenteca1bdf415c454093dfc7eb983cd49287c043967 (diff)
x86: Issue reset on triple faults (Jan Kiszka)
As discussed a few times on this list: A triple fault causes a system reset on x86, and some guests make use of this (e.g. 386BSD). To keep the chance of tracing unexpected resets, log them if CPU_LOG_RESET is set. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6453 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-i386/op_helper.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 1a615b3ba0..8cf3bb2d8e 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -1251,6 +1251,9 @@ void do_interrupt(int intno, int is_int, int error_code,
}
}
+/* This should come from sysemu.h - if we could include it here... */
+void qemu_system_reset_request(void);
+
/*
* Check nested exceptions and change to double or triple fault if
* needed. It should only be called, if this is not an interrupt.
@@ -1267,8 +1270,18 @@ static int check_exception(int intno, int *error_code)
qemu_log_mask(CPU_LOG_INT, "check_exception old: 0x%x new 0x%x\n",
env->old_exception, intno);
- if (env->old_exception == EXCP08_DBLE)
- cpu_abort(env, "triple fault");
+#if !defined(CONFIG_USER_ONLY)
+ if (env->old_exception == EXCP08_DBLE) {
+ if (env->hflags & HF_SVMI_MASK)
+ helper_vmexit(SVM_EXIT_SHUTDOWN, 0); /* does not return */
+
+ if (loglevel & CPU_LOG_RESET)
+ fprintf(logfile, "Triple fault\n");
+
+ qemu_system_reset_request();
+ return EXCP_HLT;
+ }
+#endif
if ((first_contributory && second_contributory)
|| (env->old_exception == EXCP0E_PAGE &&