From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TENdx-0004Bp-IJ for qemu-devel@nongnu.org; Wed, 19 Sep 2012 13:01:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TENdi-0008OK-CS for qemu-devel@nongnu.org; Wed, 19 Sep 2012 13:00:57 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:61004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TENdh-0008N7-Uc for qemu-devel@nongnu.org; Wed, 19 Sep 2012 13:00:42 -0400 Received: by pbbrp12 with SMTP id rp12so2904096pbb.4 for ; Wed, 19 Sep 2012 10:00:40 -0700 (PDT) Sender: Richard Henderson Message-ID: <5059FA36.1080301@twiddle.net> Date: Wed, 19 Sep 2012 10:00:38 -0700 From: Richard Henderson MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Shifts, ppc[64], xtensa List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Max Filippov , qemu-devel@nongnu.org, Aurelien Jarno On 09/19/2012 05:57 AM, Peter Maydell wrote: >> > - s->code_ptr += 16; >> > + tcg_out32 (s, NOP); >> > + tcg_out32 (s, NOP); >> > + tcg_out32 (s, NOP); >> > + tcg_out32 (s, NOP); > Not too familiar with the PPC backend, but doesn't this mean that > in the retranslation case we will overwrite a correct jump destination > with these NOP words and then rewrite it again with the correct > destination? That can cause problems with cache incoherency; > compare the fix applied in commit c69806ab8276 for ARM. Well, i386 certainly doesn't care about re-translation here: /* direct jump method */ tcg_out8(s, OPC_JMP_long); /* jmp im */ s->tb_jmp_offset[args[0]] = s->code_ptr - s->code_buf; tcg_out32(s, 0); That creates an explicit branch to next. And as far as the referenced change, that has to do with "real" branches, i.e. INDEX_op_brcond et at. Which *do* need to be protected against retranslation. But INDEX_op_goto_tb is a different case. r~