From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRXXf-0002JP-TH for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:54:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRXXf-0002J2-4w for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:54:43 -0500 Received: from [199.232.76.173] (port=50102 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRXXe-0002Iv-SW for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:54:42 -0500 Received: from savannah.gnu.org ([199.232.41.3]:58147 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRXXe-0002pi-Gl for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:54:42 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LRXXd-0003aB-Vc for qemu-devel@nongnu.org; Mon, 26 Jan 2009 19:54:42 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LRXXd-0003Zv-Qy for qemu-devel@nongnu.org; Mon, 26 Jan 2009 19:54:41 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 26 Jan 2009 19:54:41 +0000 Subject: [Qemu-devel] [6453] x86: Issue reset on triple faults (Jan Kiszka) 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 Revision: 6453 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6453 Author: aliguori Date: 2009-01-26 19:54:36 +0000 (Mon, 26 Jan 2009) Log Message: ----------- 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 Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/target-i386/op_helper.c Modified: trunk/target-i386/op_helper.c =================================================================== --- trunk/target-i386/op_helper.c 2009-01-26 19:54:31 UTC (rev 6452) +++ trunk/target-i386/op_helper.c 2009-01-26 19:54:36 UTC (rev 6453) @@ -1251,6 +1251,9 @@ } } +/* 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,9 +1270,19 @@ 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 && (second_contributory || (intno == EXCP0E_PAGE)))) {