From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCSaB-0001nD-TL for qemu-devel@nongnu.org; Tue, 07 Jul 2015 09:06:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCSa6-0002Pl-M9 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 09:06:43 -0400 Received: from greensocs.com ([193.104.36.180]:48515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCSa6-0002PR-DC for qemu-devel@nongnu.org; Tue, 07 Jul 2015 09:06:38 -0400 Message-ID: <559BCEDB.2000708@greensocs.com> Date: Tue, 07 Jul 2015 15:06:35 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> <1435330053-18733-3-git-send-email-fred.konrad@greensocs.com> <87r3ok9sur.fsf@linaro.org> <559BA87E.70601@redhat.com> <559BBC88.5030402@greensocs.com> <559BC75F.9000601@redhat.com> In-Reply-To: <559BC75F.9000601@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH V6 02/18] replace spinlock by QemuMutex. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , =?UTF-8?B?QWxleCBCZW5uw6ll?= Cc: mttcg@greensocs.com, peter.maydell@linaro.org, a.spyridakis@virtualopensystems.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, alistair.francis@xilinx.com, agraf@suse.de, guillaume.delbergue@greensocs.com On 07/07/2015 14:34, Paolo Bonzini wrote: > > On 07/07/2015 13:48, Frederic Konrad wrote: >>>> this eventually ends up doing a tb_lock on the find_slow path which IIRC >>>> is when might end up doing the actual code generation. >>> Up to this point, system emulation is using the BQL for everything. I >>> guess things change later. >> Actually we use tb_lock to protect all the tb related structure such as >> TBContext etc.. Is it better to use the global lock for this? > No, on the contrary. But using the BQL is the status as of patch 2, so > it's okay to keep the #ifdefs. Thanks for confirming that it changes > later in the patch. > > Paolo In fact I changed nothing in patch 2 except abstracting out the #ifdef from spinlock_t and using qemu_mutex (pthread_t on linux) instead of spinlock_t. The only reason for that is only to use tb_lock for both user and system mode. And yes as it's the first patch tb_lock is not used in this step except in the user code. Thanks, Fred