Received: from eggs.gnu.org ([2001:4830:134:3::10]:50616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bov3F-0002No-L9 for qemu-devel@nongnu.org; Tue, 27 Sep 2016 12:16:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bov3B-0004bM-9r for qemu-devel@nongnu.org; Tue, 27 Sep 2016 12:16:13 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bov3B-0004bC-2I for qemu-devel@nongnu.org; Tue, 27 Sep 2016 12:16:09 -0400 Received: by mail-wm0-x244.google.com with SMTP id b184so1920671wma.3 for ; Tue, 27 Sep 2016 09:16:08 -0700 (PDT) Sender: Paolo Bonzini References: <1470929064-4092-1-git-send-email-alex.bennee@linaro.org> <1470929064-4092-22-git-send-email-alex.bennee@linaro.org> From: Paolo Bonzini Message-ID: <5f679ae8-029d-66b8-8362-792b49580cd8@redhat.com> Date: Tue, 27 Sep 2016 18:16:04 +0200 MIME-Version: 1.0 In-Reply-To: <1470929064-4092-22-git-send-email-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC v4 21/28] tcg: enable tb_lock() for SoftMMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , mttcg@listserver.greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com Cc: peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, serge.fdrv@gmail.com, rth@twiddle.net On 11/08/2016 17:24, Alex Bennée wrote: > tb_lock() has long been used for linux-user mode to protect code > generation. By enabling it now we prepare for MTTCG and ensure all code > generation is serialised by this lock. The other major structure that > needs protecting is the l1_map and its PageDesc structures. For the > SoftMMU case we also use tb_lock() to protect these structures instead > of linux-user mmap_lock() which as the name suggests serialises updates > to the structure as a result of guest mmap operations. > > Signed-off-by: Alex Bennée > > --- > v4 > - split from main tcg: enable thread-per-vCPU patch Is it possible to extend this patch so that tb_lock/tb_unlock are no-ops unless tcg_enabled()? Maybe even move tb_lock/tb_unlock to tcg/tcg.h as inlines and only leaving the actual TCG path in translate-all.c... Thanks, Paolo