diff mbox

[v1,3/6] mem: fold tcg listener's logic into core memory listener

Message ID 1369793469-30883-4-git-send-email-qemulist@gmail.com
State New
Headers show

Commit Message

pingfan liu May 29, 2013, 2:11 a.m. UTC
From: Liu Ping Fan <pingfank@linux.vnet.ibm.com>

We can do the tcg listener's logic in core memory listener. And this
will help us concentrate the rcu updater.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 exec.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)
diff mbox

Patch

diff --git a/exec.c b/exec.c
index e5335f5..eb69a98 100644
--- a/exec.c
+++ b/exec.c
@@ -1761,6 +1761,7 @@  static void release_dispatch_map(AllocInfo *info)
  */
 static void core_commit(MemoryListener *listener)
 {
+    CPUArchState *env;
     AllocInfo *info = cur_alloc_info;
     info->map = cur_map_nodes;
     info->sections = cur_phys_sections;
@@ -1772,20 +1773,15 @@  static void core_commit(MemoryListener *listener)
     cur_phys_sections = next_phys_sections;
     cur_alloc_info = next_alloc_info;
 
-    /* Fix me, will changed to call_rcu */
-    release_dispatch_map(info);
-}
-
-static void tcg_commit(MemoryListener *listener)
-{
-    CPUArchState *env;
-
     /* since each CPU stores ram addresses in its TLB cache, we must
        reset the modified entries */
     /* XXX: slow ! */
-    for(env = first_cpu; env != NULL; env = env->next_cpu) {
+    for (env = first_cpu; env != NULL; env = env->next_cpu) {
         tlb_flush(env, 1);
     }
+
+    /* Fix me, will changed to call_rcu */
+    release_dispatch_map(info);
 }
 
 static void core_log_global_start(MemoryListener *listener)
@@ -1830,10 +1826,6 @@  static MemoryListener io_memory_listener = {
     .priority = 0,
 };
 
-static MemoryListener tcg_memory_listener = {
-    .commit = tcg_commit,
-};
-
 void address_space_init_dispatch(AddressSpace *as)
 {
     AddressSpaceDispatch *d = g_new(AddressSpaceDispatch, 1);
@@ -1870,7 +1862,6 @@  static void memory_map_init(void)
 
     memory_listener_register(&core_memory_listener, &address_space_memory);
     memory_listener_register(&io_memory_listener, &address_space_io);
-    memory_listener_register(&tcg_memory_listener, &address_space_memory);
 }
 
 MemoryRegion *get_system_memory(void)