From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPsB6-0004X2-QY for qemu-devel@nongnu.org; Thu, 13 Aug 2015 09:04:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPsB2-0004sC-2s for qemu-devel@nongnu.org; Thu, 13 Aug 2015 09:04:16 -0400 Received: from greensocs.com ([193.104.36.180]:38023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPsB1-0004rx-RL for qemu-devel@nongnu.org; Thu, 13 Aug 2015 09:04:11 -0400 Message-ID: <55CC95C4.5080600@greensocs.com> Date: Thu, 13 Aug 2015 15:04:04 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1439397664-70734-1-git-send-email-pbonzini@redhat.com> <1439397664-70734-13-git-send-email-pbonzini@redhat.com> <55CC9422.3070602@greensocs.com> <947372426.11934530.1439470901539.JavaMail.zimbra@redhat.com> In-Reply-To: <947372426.11934530.1439470901539.JavaMail.zimbra@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/10] tcg: protect TBContext with tb_lock. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@greensocs.com, qemu-devel@nongnu.org On 13/08/2015 15:01, Paolo Bonzini wrote: >>> + tb_lock(); >>> tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base, orig_tb->flags, >>> max_cycles | CF_NOCACHE); >> tb_gen_code() calls tb_alloc() which calls tb_flush() we end in a double >> tb_lock here. >> But that's probably not really important here as we want to either do a >> tb_flush outside cpu_exec or realloc an other code buffer. > You're right! Honestly I haven't tested tb_flush() at all with these > patches since it's documented as broken with multiple threads. > > Luckily the bug is not in the first 10 patches. :) Fortunately this revealed my yesterday bug with tb_alloc :). Fred > > Paolo