[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 3/6] mem: fold tcg listener's logic into core mem
From: |
Liu Ping Fan |
Subject: |
[Qemu-devel] [PATCH v1 3/6] mem: fold tcg listener's logic into core memory listener |
Date: |
Wed, 29 May 2013 10:11:06 +0800 |
From: Liu Ping Fan <address@hidden>
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 <address@hidden>
---
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
[Qemu-devel] [PATCH v1 5/6] mem: make dispatch path satify rcu style, Liu Ping Fan, 2013/05/28
[Qemu-devel] [PATCH v1 6/6] mem: change tcg code to rcu style, Liu Ping Fan, 2013/05/28