From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IFswV-00034w-4D for qemu-devel@nongnu.org; Tue, 31 Jul 2007 10:43:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IFswS-00034M-Ke for qemu-devel@nongnu.org; Tue, 31 Jul 2007 10:43:22 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFswS-00034E-HE for qemu-devel@nongnu.org; Tue, 31 Jul 2007 10:43:20 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IFswR-0004JP-W6 for qemu-devel@nongnu.org; Tue, 31 Jul 2007 10:43:20 -0400 Received: from chrom.inf.tu-dresden.de ([141.76.48.24]) by os.inf.tu-dresden.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) id 1IFswP-0004NB-5b for qemu-devel@nongnu.org; Tue, 31 Jul 2007 16:43:17 +0200 Received: from kauer by chrom.inf.tu-dresden.de with local (Exim 4.67) (envelope-from ) id 1IFswO-0002nS-TX for qemu-devel@nongnu.org; Tue, 31 Jul 2007 16:43:16 +0200 Date: Tue, 31 Jul 2007 16:43:16 +0200 Message-ID: <20070731144316.GA10391@chrom.inf.tu-dresden.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline From: Bernhard Kauer Subject: [Qemu-devel] Patch: fix init of old_exception 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 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The old_exception field is initialized on startup with 0. Therefore the very first fault (e.g. #GP) could be converted to a double fault on an application processor. The attached patch initialize old_exception on every CPU reset with -1. Bernhard Kauer --Q68bSM7Ycu6FN28Q Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="qemu_init_old_exception.diff" Index: target-i386/helper2.c =================================================================== RCS file: /sources/qemu/qemu/target-i386/helper2.c,v retrieving revision 1.47 diff -u -r1.47 helper2.c --- target-i386/helper2.c 17 Apr 2007 23:08:56 -0000 1.47 +++ target-i386/helper2.c 31 Jul 2007 14:30:55 -0000 @@ -155,6 +155,8 @@ tlb_flush(env, 1); + env->old_exception = -1; + /* init to reset state */ #ifdef CONFIG_SOFTMMU --Q68bSM7Ycu6FN28Q--