From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel@nongnu.org
Cc: kwolf@suse.de
Subject: [Qemu-devel] [RESENT][PATCH 2/2] x86: Issue reset on triple faults
Date: Mon, 23 Jun 2008 17:15:36 +0200 [thread overview]
Message-ID: <485FBE18.4090603@siemens.com> (raw)
As discussed a few times on this list: A triple fault causes a system
reset on x86, and some guests make use of this. 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>
---
target-i386/op_helper.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
Index: b/target-i386/op_helper.c
===================================================================
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -1230,6 +1230,9 @@ void do_interrupt(int intno, int is_int,
}
}
+/* 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.
@@ -1247,8 +1250,18 @@ static int check_exception(int intno, in
fprintf(logfile, "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);
+
+ 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 &&
next reply other threads:[~2008-06-23 15:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 15:15 Jan Kiszka [this message]
2008-06-23 15:23 ` [Qemu-devel] [RESENT][PATCH 2/2] x86: Issue reset on triple faults Jamie Lokier
2008-06-23 15:35 ` [Qemu-devel] " Jan Kiszka
2008-06-23 16:00 ` Jamie Lokier
2008-06-23 20:01 ` Natalia Portillo
2008-06-24 6:39 ` Jan Kiszka
2008-06-24 8:18 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=485FBE18.4090603@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=kwolf@suse.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).