qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH qemu] exec: Destroy dispatch immediately


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH qemu] exec: Destroy dispatch immediately
Date: Fri, 25 Aug 2017 11:01:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 25/08/2017 10:31, Alexey Kardashevskiy wrote:
> Each address_space_init() updates topology for _every_ address space.

And finally, does this patch help with the above?

diff --git a/memory.c b/memory.c
index c0adc35..97c16cc 100644
--- a/memory.c
+++ b/memory.c
@@ -2607,10 +2607,16 @@ void memory_region_invalidate_mmio_ptr(MemoryRegion 
*mr, hwaddr offset,
                           RUN_ON_CPU_HOST_PTR(invalidate_data));
 }
 
+static void address_space_rebuild(AddressSpace *as)
+{
+    MEMORY_LISTENER_CALL(as, begin, Forward);
+    address_space_update_topology(as);
+    MEMORY_LISTENER_CALL(as, commit, Forward);
+}
+
 void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name)
 {
     memory_region_ref(root);
-    memory_region_transaction_begin();
     as->ref_count = 1;
     as->root = root;
     as->malloced = false;
@@ -2622,8 +2628,7 @@ void address_space_init(AddressSpace *as, MemoryRegion 
*root, const char *name)
     QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link);
     as->name = g_strdup(name ? name : "anonymous");
     address_space_init_dispatch(as);
-    memory_region_update_pending |= root->enabled;
-    memory_region_transaction_commit();
+    address_space_rebuild(as);
 }
 
 static void do_address_space_destroy(AddressSpace *as)


Completely untested because vacation is coming.

Thanks,

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]