Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GDbOZ-000328-Rj for qemu-devel@nongnu.org; Thu, 17 Aug 2006 02:30:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GDbOY-00030R-T8 for qemu-devel@nongnu.org; Thu, 17 Aug 2006 02:30:23 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GDbOY-00030H-OG for qemu-devel@nongnu.org; Thu, 17 Aug 2006 02:30:22 -0400 Received: from [62.8.134.5] (helo=mail.sysgo.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GDbUz-0002oD-0I for qemu-devel@nongnu.org; Thu, 17 Aug 2006 02:37:01 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.sysgo.com (Postfix) with ESMTP id 7D93ECC1BF for ; Thu, 17 Aug 2006 08:30:19 +0200 (CEST) Received: from donald.sysgo.com (unknown [172.20.1.30]) by mail.sysgo.com (Postfix) with ESMTP id 2F0E8CC1BC for ; Thu, 17 Aug 2006 08:30:19 +0200 (CEST) Received: from mag.sysgo.com (mag.sysgo.com [172.24.2.130]) by donald.sysgo.com (Postfix) with ESMTP id DC7F22685CB for ; Thu, 17 Aug 2006 08:30:18 +0200 (CEST) Date: Thu, 17 Aug 2006 08:30:18 +0200 (CEST) From: Marius Groeger Sender: mag@sysgo.com Subject: Re: [Qemu-devel] Wrong reset of MIPS hflags EXL after interrupt? In-Reply-To: <44E37D8E.3050801@gmail.com> Message-ID: References: <44E3500A.4050608@gmail.com> <20060816182908.GC6387@networkno.de> <44E37D8E.3050801@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 On Wed, 16 Aug 2006, Dirk Behme wrote: >> AFAIU qemu maintains an environment stack, I guess popping the >> environment restores the old flag contents. > > Anybody with a short explanation of the basics of this? I think this would > really help debugging this issue. I don't think it's really a stack (see translate.c:save_cpu_state()), but anyway as far as I got it it is used to save the context where the emulation has to prepare to deliver that context either to an exception or to the code managing branches (delay slots, likely's etc.) In some instances you'll see that the "pc" counter of the saved context is manually incremented by one insn; one obvious example is the "wait" instruction where you really want to continue with the following insn once an exception kicks the emulation out of its nap. I agree, though, that in your debugging, you probably examined a wrong context. The actual, current context's EXL should be correct, otherwise things wouldn't be working at all. Having said that, I'm currently playing with nested interrupts - let's see how that checks out... :-) Glad for any correction of my half-understanding of qemu, Marius -- Marius Groeger SYSGO AG Embedded and Real-Time Software Voice: +49 6136 9948 0 FAX: +49 6136 9948 10 www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com