From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhVrW-0002J6-Jf for qemu-devel@nongnu.org; Tue, 28 May 2013 22:11:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhVrV-0001mS-L4 for qemu-devel@nongnu.org; Tue, 28 May 2013 22:11:38 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:55813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhVrV-0001mO-F8 for qemu-devel@nongnu.org; Tue, 28 May 2013 22:11:37 -0400 Received: by mail-pa0-f41.google.com with SMTP id rl6so8738275pac.28 for ; Tue, 28 May 2013 19:11:36 -0700 (PDT) From: Liu Ping Fan Date: Wed, 29 May 2013 10:11:06 +0800 Message-Id: <1369793469-30883-4-git-send-email-qemulist@gmail.com> In-Reply-To: <1369793469-30883-1-git-send-email-qemulist@gmail.com> References: <1369793469-30883-1-git-send-email-qemulist@gmail.com> Subject: [Qemu-devel] [PATCH v1 3/6] mem: fold tcg listener's logic into core memory listener List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori From: Liu Ping Fan 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 --- exec.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) 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) -- 1.7.4.4