From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JffZD-0006LT-Dh for qemu-devel@nongnu.org; Sat, 29 Mar 2008 14:14:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JffZB-0006Kf-S9 for qemu-devel@nongnu.org; Sat, 29 Mar 2008 14:14:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JffZB-0006KZ-Nt for qemu-devel@nongnu.org; Sat, 29 Mar 2008 14:14:09 -0400 Received: from smtp3-g19.free.fr ([212.27.42.29]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JffZB-0002nB-E8 for qemu-devel@nongnu.org; Sat, 29 Mar 2008 14:14:09 -0400 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id C40D617B59A for ; Sat, 29 Mar 2008 19:14:05 +0100 (CET) Received: from [127.0.0.1] (rob92-10-88-171-126-33.fbx.proxad.net [88.171.126.33]) by smtp3-g19.free.fr (Postfix) with ESMTP id 7A7D517B55A for ; Sat, 29 Mar 2008 19:14:05 +0100 (CET) Message-ID: <47EE86E0.4070703@reactos.org> Date: Sat, 29 Mar 2008 19:13:52 +0100 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070104080200080306000307" Subject: [Qemu-devel] [PATCH] Reboot CPU on triple fault 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 This is a multi-part message in MIME format. --------------070104080200080306000307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Hi, On i386/x86-64, CPU must reboot when a triple fault is detected. Attached patch implements this behaviour. Herv=E9 --------------070104080200080306000307 Content-Type: text/plain; name="triple_fault.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="triple_fault.patch" Index: target-i386/helper.c =================================================================== RCS file: /sources/qemu/qemu/target-i386/helper.c,v retrieving revision 1.103 diff -u -r1.103 target-i386/helper.c --- target-i386/helper.c 28 Mar 2008 22:30:30 -0000 1.103 +++ target-i386/helper.c 28 Mar 2008 22:55:52 -0000 @@ -1276,6 +1276,11 @@ { if (!is_int) { svm_check_intercept_param(SVM_EXIT_EXCP_BASE + intno, error_code); + if (env->old_exception == EXCP08_DBLE) { + cpu_loop_exit(); + cpu_reset(env); + return; + } intno = check_exception(intno, &error_code); } @@ -1289,6 +1294,11 @@ /* same as raise_exception_err, but do not restore global registers */ static void raise_exception_err_norestore(int exception_index, int error_code) { + if (env->old_exception == EXCP08_DBLE) { + cpu_loop_exit(); + cpu_reset(env); + return; + } exception_index = check_exception(exception_index, &error_code); env->exception_index = exception_index; --------------070104080200080306000307--