From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai83v-0007Th-Ak for qemu-devel@nongnu.org; Mon, 21 Mar 2016 18:12:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai83r-0008G9-W9 for qemu-devel@nongnu.org; Mon, 21 Mar 2016 18:12:35 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai83r-0008G5-Ot for qemu-devel@nongnu.org; Mon, 21 Mar 2016 18:12:31 -0400 Received: by mail-wm0-x22f.google.com with SMTP id r129so68849763wmr.1 for ; Mon, 21 Mar 2016 15:12:31 -0700 (PDT) Sender: Paolo Bonzini References: <1458317932-1875-1-git-send-email-alex.bennee@linaro.org> <1458317932-1875-4-git-send-email-alex.bennee@linaro.org> <56EC3402.1030007@redhat.com> <20160321215044.GA5098@flamenco> From: Paolo Bonzini Message-ID: <56F071CB.7040906@redhat.com> Date: Mon, 21 Mar 2016 23:12:27 +0100 MIME-Version: 1.0 In-Reply-To: <20160321215044.GA5098@flamenco> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: mttcg@greensocs.com, Peter Crosthwaite , mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, serge.fdrv@gmail.com, fred.konrad@greensocs.com, =?UTF-8?Q?Alex_Benn=c3=a9e?= , =?UTF-8?Q?Andreas_F=c3=a4rber?= , Richard Henderson On 21/03/2016 22:50, Emilio G. Cota wrote: > The problem with this approach is that the "point TCG to second buffer" > is not just a question of pointing code_gen_buffer to a new address; > we'd have to create a new tcg_ctx struct, since tcg_ctx has quite a few > elements that are dependent on code_gen_buffer (e.g. s->code_ptr, > s->code_buf). Are these (or other fields similarly dependent on code_gen_buffer) ever read outside tb_lock? A quick "git grep -wl" suggests that they are only used from tcg/, which should only run while tb_lock is held. If not it would be enough to call tcg_prologue_init from tb_flush. Paolo