From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhcHz-0003A3-BC for qemu-devel@nongnu.org; Wed, 29 May 2013 05:03:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhcHu-0001Bm-IL for qemu-devel@nongnu.org; Wed, 29 May 2013 05:03:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhcHu-0001Be-Ba for qemu-devel@nongnu.org; Wed, 29 May 2013 05:03:18 -0400 Message-ID: <51A5C446.8090305@redhat.com> Date: Wed, 29 May 2013 11:03:02 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1369793469-30883-1-git-send-email-qemulist@gmail.com> <1369793469-30883-7-git-send-email-qemulist@gmail.com> <51A5ACCF.9020504@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 6/6] mem: change tcg code to rcu style List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: qemu-devel@nongnu.org, Anthony Liguori Il 29/05/2013 11:00, liu ping fan ha scritto: >> Remember that this code is running under the BQL, so there is no need to >> protect the TLB flushes otherwise. There is also no need to do anything > > Do you mean that cpu_exec() can not be out of BQL like kvm path? If > it is true, then there is no changes needed for tcg code, right? Indeed. When/if a fine-grained lock is introduced, it will protect TLB accesses vs. TLB flushes. For now, the BQL will do. Making TCG multi-threaded is a wholly different problem, and a superset of what's needed for KVM. (Xen instead is almost the same, only the mapcache has to be protected by its own mutex). >> as long as you ref the regions that are entered in the map, and unref >> them when you destroy the map. Those refs will protect TCG's TLB too. >> > Worry about whether the TLB is the right index in the right > phys_sections, if the mem topology changes between tlb_set_page() and > instruction emulated. That's not possible because of BQL protection. >> In the end, all of TCG's execution consists of a large RCU critical section. > > Even stronger? If it runs with BQL protection. Yes. Paolo