From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0UK3-0004be-Bu for qemu-devel@nongnu.org; Wed, 11 May 2016 09:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0UJz-0003BI-42 for qemu-devel@nongnu.org; Wed, 11 May 2016 09:37:06 -0400 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:34040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0UJy-0003BE-Px for qemu-devel@nongnu.org; Wed, 11 May 2016 09:37:03 -0400 Received: by mail-lf0-x236.google.com with SMTP id m64so49602294lfd.1 for ; Wed, 11 May 2016 06:37:02 -0700 (PDT) References: <1459870344-16773-1-git-send-email-alex.bennee@linaro.org> <1459870344-16773-5-git-send-email-alex.bennee@linaro.org> <572CE0CD.3040004@gmail.com> <57332C6A.1080006@redhat.com> From: Sergey Fedorov Message-ID: <57333578.4080609@gmail.com> Date: Wed, 11 May 2016 16:36:56 +0300 MIME-Version: 1.0 In-Reply-To: <57332C6A.1080006@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 04/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: Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= , mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org Cc: peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, =?UTF-8?Q?Andreas_F=c3=a4rber?= , rth@twiddle.net On 11/05/16 15:58, Paolo Bonzini wrote: > > On 06/05/2016 20:22, Sergey Fedorov wrote: >> However, there's no sensible description of what is protected by tb_lock >> and mmap_lock. I think we need to have a clear documented description of >> the TCG locking scheme in order to be sure we do right things in MTTCG. > I think there was such a patch somewhere, but: tb_lock basically > protects tcg_ctx, while mmap_lock protects the user-mode emulation page > table (the equivalent for system emulation is the memory map which is > protected by the BQL). Furthermore, mmap_lock must be taken outside > tb_lock. What's a user-mode emulation page table? 'l1_map'? It is used by system emulation to keep track of TBs per page and 'code_bitmap'. Shouldn't it be protected with 'mmap_lock' in system emulation? Thanks, Sergey