aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2013-10-14 17:14:47 +0200
committerJuan Quintela <quintela@redhat.com>2014-01-13 14:04:54 +0100
commit12291ec18fdce3c1973c172f5a942a1bd26b9a5f (patch)
tree71c1aaea2fcfdb236ee4f91868f34add897cc180
parent220c3ebddbd1ac289ae7fc64733c9501b3921d94 (diff)
memory: unfold memory_region_test_and_clear()
We are going to update the bitmap directly Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
-rw-r--r--arch_init.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch_init.c b/arch_init.c
index e0acbc5661..0e8c8b5fc1 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -48,6 +48,7 @@
#include "qmp-commands.h"
#include "trace.h"
#include "exec/cpu-all.h"
+#include "exec/ram_addr.h"
#include "hw/acpi/acpi.h"
#ifdef DEBUG_ARCH_INIT
@@ -400,9 +401,12 @@ static void migration_bitmap_sync(void)
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
for (addr = 0; addr < block->length; addr += TARGET_PAGE_SIZE) {
- if (memory_region_test_and_clear_dirty(block->mr,
- addr, TARGET_PAGE_SIZE,
- DIRTY_MEMORY_MIGRATION)) {
+ if (cpu_physical_memory_get_dirty(block->mr->ram_addr + addr,
+ TARGET_PAGE_SIZE,
+ DIRTY_MEMORY_MIGRATION)) {
+ cpu_physical_memory_reset_dirty(block->mr->ram_addr + addr,
+ TARGET_PAGE_SIZE,
+ DIRTY_MEMORY_MIGRATION);
migration_bitmap_set_dirty(block->mr, addr);
}
}