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