aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-10-02 18:54:45 +0200
committerAvi Kivity <avi@redhat.com>2012-10-22 14:50:07 +0200
commit1d71148eace669827ba15101819b54b20fcca616 (patch)
tree405d3ca7e6a8a749f083013d20f4709bcca7fe3b
parent2673a5da25ea9005e562c20a18cf469ed4f21060 (diff)
memory: move tcg flush into a tcg memory listener
We plan to make the core listener listen to all address spaces; this will cause many more flushes than necessary. Prepare for that by moving the flush into a tcg-specific listener. Later we can avoid registering the listener if tcg is disabled. Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--exec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index dfc0a784f3..6a7ba0cea6 100644
--- a/exec.c
+++ b/exec.c
@@ -3166,7 +3166,7 @@ static void core_begin(MemoryListener *listener)
phys_section_watch = dummy_section(&io_mem_watch);
}
-static void core_commit(MemoryListener *listener)
+static void tcg_commit(MemoryListener *listener)
{
CPUArchState *env;
@@ -3220,7 +3220,6 @@ static void io_region_del(MemoryListener *listener,
static MemoryListener core_memory_listener = {
.begin = core_begin,
- .commit = core_commit,
.region_add = core_region_add,
.region_nop = core_region_nop,
.log_global_start = core_log_global_start,
@@ -3234,6 +3233,10 @@ static MemoryListener io_memory_listener = {
.priority = 0,
};
+static MemoryListener tcg_memory_listener = {
+ .commit = tcg_commit,
+};
+
static void memory_map_init(void)
{
system_memory = g_malloc(sizeof(*system_memory));
@@ -3248,6 +3251,7 @@ static void memory_map_init(void)
memory_listener_register(&core_memory_listener, system_memory);
memory_listener_register(&io_memory_listener, system_io);
+ memory_listener_register(&tcg_memory_listener, system_memory);
}
MemoryRegion *get_system_memory(void)