From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAnle-0004eG-UZ for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAnld-0004cw-HG for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:42 -0400 Received: from [199.232.76.173] (port=35720 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAnld-0004cj-47 for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:41 -0400 Received: from gecko.sbs.de ([194.138.37.40]:15968) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAnld-0005L5-4f for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:41 -0400 Message-ID: <485FBE18.4090603@siemens.com> Date: Mon, 23 Jun 2008 17:15:36 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RESENT][PATCH 2/2] x86: Issue reset on triple faults Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@suse.de 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 --- 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 &&