From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GDOoX-0000Ze-6E for qemu-devel@nongnu.org; Wed, 16 Aug 2006 13:04:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GDOoT-0000TP-Ma for qemu-devel@nongnu.org; Wed, 16 Aug 2006 13:04:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GDOoT-0000TC-Hm for qemu-devel@nongnu.org; Wed, 16 Aug 2006 13:04:17 -0400 Received: from [66.249.82.227] (helo=wx-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GDOum-0000Oh-3h for qemu-devel@nongnu.org; Wed, 16 Aug 2006 13:10:48 -0400 Received: by wx-out-0506.google.com with SMTP id r21so194514wxc for ; Wed, 16 Aug 2006 10:04:16 -0700 (PDT) Message-ID: <44E3500A.4050608@gmail.com> Date: Wed, 16 Aug 2006 19:04:10 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Dirk Behme Subject: [Qemu-devel] Wrong reset of MIPS hflags EXL after interrupt? 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 Hi, I'm not sure, but while playing with MIPS interrupts, it seems to me that something with reset of interrupt flag MIPS_HFLAG_EXL (0x04) at exception exit (eret) is wrong. It seems to me that only one interrupt is executed because after eret, MIPS_HFLAG_EXL stays set in env->hflags. Then, at next interrupt, system correctly checks for MIPS_HFLAG_EXL, but this is still set and no further interrupt happens. Debugging shows that op_eret() in MIPS op.c correctly reset this bit: env->hflags &= ~MIPS_HFLAG_EXL; But debug output at end of e.g. save_cpu_state() (debug output of ctx->hflags and ctx->saved_hflags ) or in function which tries to issue (next) timer interrupt (debug output of env->hflags) MIPS_HFLAG_EXL is still (again?) set everywhere. Looks like the correct env->hflags from op_eret() is overwritten somewhere later with wrong value. These three ctx->hflags, ctx->saved_hflags and env->hflags are confusing me ;) Where are they synchronized after eret? Or who overwrites the env->hflags correctly set by eret again? Any ideas, why eret sets env->hflags correctly and later global env->hflags has still/again wrong value? Any other hints? Many thanks Dirk Debug output shows something like: save_cpu_state(): ctx->hflags 00000000 ctx->saved_hflags 00000000 MIPS Timer #1: Status: 0x80408401, Cause: 0x00008000, env->hflags: 0x00000000 save_cpu_state():ctx->hflags 00000004 ctx->saved_hflags 00000004 ** Interrupt handler called... ** Start of op_eret(): env->hflags 0x00000204 Status 0x80408403 ** End of op_eret(): env->hflags 0x00000200 Status 0x80408401 save_cpu_state():ctx->hflags 00000004 ctx->saved_hflags 00000004 save_cpu_state():ctx->hflags 00000004 ctx->saved_hflags 00000004 save_cpu_state():ctx->hflags 00000004 ctx->saved_hflags 00000004 ... MIPS Timer #2: Status: 0x80408401, Cause: 0x00008000, env->hflags: 0x00000004 MIPS Timer #3: Status: 0x80408401, Cause: 0x00008000, env->hflags: 0x00000004 MIPS Timer #4: Status: 0x80408401, Cause: 0x00008000, env->hflags: 0x00000004 MIPS Timer #5: Status: 0x80408401, Cause: 0x00008000, env->hflags: 0x00000004 ....