From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auuvB-0008WF-AX for qemu-devel@nongnu.org; Tue, 26 Apr 2016 00:48:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auuv7-0005d4-7L for qemu-devel@nongnu.org; Tue, 26 Apr 2016 00:48:25 -0400 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]:32785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auuv7-0005d0-2V for qemu-devel@nongnu.org; Tue, 26 Apr 2016 00:48:21 -0400 Received: by mail-qg0-x22a.google.com with SMTP id f92so1261323qgf.0 for ; Mon, 25 Apr 2016 21:48:20 -0700 (PDT) Sender: Richard Henderson References: <20160425152528.GA16402@flamenco> <1461627983-32563-1-git-send-email-cota@braap.org> From: Richard Henderson Message-ID: <8b49fdbb-fe67-ce03-c288-f31b4f34af8b@twiddle.net> Date: Mon, 25 Apr 2016 21:48:16 -0700 MIME-Version: 1.0 In-Reply-To: <1461627983-32563-1-git-send-email-cota@braap.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v3] translate-all: protect code_gen_buffer with RCU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" , QEMU Developers , MTTCG Devel Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Peter Crosthwaite , Sergey Fedorov On 04/25/2016 04:46 PM, Emilio G. Cota wrote: > + /* > + * write the prologue into buf2. This is safe because we'll later call > + * tcg_prologue_init on buf1, from which we'll start execution. > + */ > + tcg_ctx.code_gen_buffer = code_gen_buf2; > + tcg_prologue_init(&tcg_ctx); > + Ah, no. Write only one prologue, not one per buffer. If they're sufficiently close (i.e. one allocation under the max size), then the same one can be used for both halves. The global variables that you didn't see in this revision are: aarch64/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; arm/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; i386/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; ia64/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; ia64/tcg-target.inc.c: tcg_insn_unit *thunks[8] = { }; mips/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; ppc/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; s390/tcg-target.inc.c:static tcg_insn_unit *tb_ret_addr; sparc/tcg-target.inc.c:static tcg_insn_unit *qemu_ld_trampoline[16]; sparc/tcg-target.inc.c:static tcg_insn_unit *qemu_st_trampoline[16]; r~