From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOrz3-0007bK-Vq for qemu-devel@nongnu.org; Mon, 10 Aug 2015 14:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOryz-0005pL-Ry for qemu-devel@nongnu.org; Mon, 10 Aug 2015 14:39:41 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:33505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOryz-0005p4-LL for qemu-devel@nongnu.org; Mon, 10 Aug 2015 14:39:37 -0400 Received: by wijp15 with SMTP id p15so146796438wij.0 for ; Mon, 10 Aug 2015 11:39:37 -0700 (PDT) References: <1439220437-23957-1-git-send-email-fred.konrad@greensocs.com> <1439220437-23957-8-git-send-email-fred.konrad@greensocs.com> <55C8D31A.8070703@redhat.com> <55C8D66A.2060404@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <55C8D66A.2060404@redhat.com> Date: Mon, 10 Aug 2015 19:39:34 +0100 Message-ID: <878u9jgf89.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH V7 07/19] protect TBContext with tb_lock. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@listserver.greensocs.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, fred.konrad@greensocs.com Paolo Bonzini writes: > On 10/08/2015 18:36, Paolo Bonzini wrote: >>> > diff --git a/target-arm/translate.c b/target-arm/translate.c >>> > index 69ac18c..960c75e 100644 >>> > --- a/target-arm/translate.c >>> > +++ b/target-arm/translate.c >>> > @@ -11166,6 +11166,8 @@ static inline void gen_intermediate_code_internal(ARMCPU *cpu, >>> > >>> > dc->tb = tb; >>> > >>> > + tb_lock(); >> This locks twice, I think? Both cpu_restore_state_from_tb and >> tb_gen_code (which calls cpu_gen_code) take the lock. How does it work? >> > > ... ah, the lock is recursive! > > I think this can be avoided. Let's look at it next week. I take it your around on the Tuesday (Fred and I arrive Monday evening). Shall we pick a time or hunt for each other in the hacking room? > > Paolo -- Alex Bennée