From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0Tid-0004rZ-5t for qemu-devel@nongnu.org; Wed, 11 May 2016 08:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0TiY-0001Z1-5h for qemu-devel@nongnu.org; Wed, 11 May 2016 08:58:26 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:36227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0TiX-0001Yo-W1 for qemu-devel@nongnu.org; Wed, 11 May 2016 08:58:22 -0400 Received: by mail-wm0-x22d.google.com with SMTP id n129so218609833wmn.1 for ; Wed, 11 May 2016 05:58:21 -0700 (PDT) Sender: Paolo Bonzini 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> From: Paolo Bonzini Message-ID: <57332C6A.1080006@redhat.com> Date: Wed, 11 May 2016 14:58:18 +0200 MIME-Version: 1.0 In-Reply-To: <572CE0CD.3040004@gmail.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: Sergey Fedorov , =?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 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. Paolo