From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0UP4-0001eZ-Ou for qemu-devel@nongnu.org; Wed, 11 May 2016 09:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0UOz-00047M-Je for qemu-devel@nongnu.org; Wed, 11 May 2016 09:42:17 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:33534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0UOz-00047I-15 for qemu-devel@nongnu.org; Wed, 11 May 2016 09:42:13 -0400 Received: by mail-lf0-x244.google.com with SMTP id j8so5142912lfd.0 for ; Wed, 11 May 2016 06:42:12 -0700 (PDT) References: <1459870344-16773-1-git-send-email-alex.bennee@linaro.org> <1459870344-16773-6-git-send-email-alex.bennee@linaro.org> <5733295B.8090401@gmail.com> <57332B24.9090304@redhat.com> From: Sergey Fedorov Message-ID: <573336B2.4000509@gmail.com> Date: Wed, 11 May 2016 16:42:10 +0300 MIME-Version: 1.0 In-Reply-To: <57332B24.9090304@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 05/11] tcg: protect TBContext with tb_lock. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= , mttcg@greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org Cc: qemu-devel@nongnu.org, mark.burton@greensocs.com, jan.kiszka@siemens.com, rth@twiddle.net, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite , "Michael S. Tsirkin" , Eduardo Habkost On 11/05/16 15:52, Paolo Bonzini wrote: > Just a couple answers/remarks. > > On 11/05/2016 14:45, Sergey Fedorov wrote: (snip) >>> @@ -1350,6 +1352,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end, >>> /* we remove all the TBs in the range [start, end[ */ >>> /* XXX: see if in some cases it could be faster to invalidate all >>> the code */ >>> + tb_lock(); >> Don't we need also protect a call to page_find() above? page_find() >> calls page_find_alloc() which is noted to be called with 'tb_lock' held. > Only if alloc=1; page_find calls it with alloc=0. Year, right :) >> However, it might depend on the way we treat 'mmap_lock' in system mode >> emulation. > It's just not there; generally speaking it's replaced with tb_lock. So why do we need yet another lock, 'mmap_lock', for user-mode emulation and don't need it for system mode? Kind regards, Sergey