From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agcAs-0000oy-GA for qemu-devel@nongnu.org; Thu, 17 Mar 2016 13:57:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agcAo-00089F-Fq for qemu-devel@nongnu.org; Thu, 17 Mar 2016 13:57:30 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:34967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agcAo-00088z-AU for qemu-devel@nongnu.org; Thu, 17 Mar 2016 13:57:26 -0400 Received: by mail-qk0-x244.google.com with SMTP id s5so2775228qkd.2 for ; Thu, 17 Mar 2016 10:57:25 -0700 (PDT) Sender: Richard Henderson References: <1458222382-6498-1-git-send-email-sergey.fedorov@linaro.org> <1458222382-6498-4-git-send-email-sergey.fedorov@linaro.org> From: Richard Henderson Message-ID: <56EAF001.2050303@twiddle.net> Date: Thu, 17 Mar 2016 10:57:21 -0700 MIME-Version: 1.0 In-Reply-To: <1458222382-6498-4-git-send-email-sergey.fedorov@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] tcg: always keep jump target and tb->jmp_next consistent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sergey.fedorov@linaro.org, qemu-devel@nongnu.org Cc: Sergey Fedorov , Peter Crosthwaite , Paolo Bonzini On 03/17/2016 06:46 AM, sergey.fedorov@linaro.org wrote: > From: Paolo Bonzini > > Simple code simplification. > > Signed-off-by: Paolo Bonzini > Signed-off-by: Sergey Fedorov > --- > translate-all.c | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > > diff --git a/translate-all.c b/translate-all.c > index f17ace1ae899..a1ac9841de48 100644 > --- a/translate-all.c > +++ b/translate-all.c > @@ -927,6 +927,14 @@ static inline void tb_page_remove(TranslationBlock **ptb, TranslationBlock *tb) > } > } > > +/* reset the jump entry 'n' of a TB so that it is not chained to > + another TB */ > +static inline void tb_reset_jump(TranslationBlock *tb, int n) > +{ > + tb_set_jmp_target(tb, n, (uintptr_t)(tb->tc_ptr + tb->tb_next_offset[n])); > + tb->jmp_next[n] = NULL; > +} > + > static inline void tb_jmp_remove(TranslationBlock *tb, int n) > { > TranslationBlock *tb1, **ptb; > @@ -951,18 +959,10 @@ static inline void tb_jmp_remove(TranslationBlock *tb, int n) > } > /* now we can suppress tb(n) from the list */ > *ptb = tb->jmp_next[n]; > - > - tb->jmp_next[n] = NULL; > + tb_reset_jump(tb, n); What's the motivation here? This implies an extra cache flush. Where were we resetting the jump previously? Or is this a bug in that we *weren't* resetting the jump previously? r~