Hi, Peter,
On 2023/3/10 下午10:51, Peter Xu wrote:
On Fri, Mar 10, 2023 at 10:24:22AM +0800, Chuang Xu wrote:
Split memory_region_transaction_do_commit() from
memory_region_transaction_commit().
We'll call do_commit() in address_space_to_flatview() in the later patch.
Signed-off-by: Chuang Xu <xuchuangxc...@bytedance.com>
[...]
+void memory_region_transaction_commit(void)
+{
+ assert(memory_region_transaction_depth);
+ assert(qemu_mutex_iothread_locked());
This context has nothing to assert BQL, so this can be dropped I think (you
have one in do_commit).
do_commit() will be triggered only when depth is 0. Before do_commit() is
triggered, we must ensure that the BQL is held when the depth is modified.
+
+ --memory_region_transaction_depth;
+ if (!memory_region_transaction_depth) {
+ memory_region_transaction_do_commit();
+ }
}
With above dropped:
Reviewed-by: Peter Xu <pet...@redhat.com>
Thanks!