From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59695 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pf8ta-0007xH-M6 for qemu-devel@nongnu.org; Tue, 18 Jan 2011 05:34:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pf8tZ-0000Gm-2R for qemu-devel@nongnu.org; Tue, 18 Jan 2011 05:34:38 -0500 Received: from hall.aurel32.net ([88.191.126.93]:41251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pf8tY-0000FU-UB for qemu-devel@nongnu.org; Tue, 18 Jan 2011 05:34:37 -0500 Date: Tue, 18 Jan 2011 11:34:28 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 1/3] mips: Break TBs after mfc0_count Message-ID: <20110118103427.GJ2577@volta.aurel32.net> References: <1295306982-29629-1-git-send-email-edgar.iglesias@gmail.com> <1295306982-29629-2-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1295306982-29629-2-git-send-email-edgar.iglesias@gmail.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: edgar.iglesias@gmail.com Cc: qemu-devel@nongnu.org On Tue, Jan 18, 2011 at 12:29:40AM +0100, edgar.iglesias@gmail.com wrote: > From: Edgar E. Iglesias > > Break the TB after reading the count register. This makes it > possible to take timer interrupts immediately after a read of > a possibly expired timer. > > Signed-off-by: Edgar E. Iglesias > --- > target-mips/translate.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/target-mips/translate.c b/target-mips/translate.c > index cce77be..313cc29 100644 > --- a/target-mips/translate.c > +++ b/target-mips/translate.c > @@ -3410,8 +3410,10 @@ static void gen_mfc0 (CPUState *env, DisasContext *ctx, TCGv arg, int reg, int s > gen_helper_mfc0_count(arg); > if (use_icount) { > gen_io_end(); > - ctx->bstate = BS_STOP; > } > + /* Break the TB to be able to take timer interrupts immediately > + after reading count. */ > + ctx->bstate = BS_STOP; > rn = "Count"; > break; > /* 6,7 are implementation dependent */ This looks fine, however it should probably be done the same way for dmfc0 on 64-bit MIPS. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net