aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-07-31 22:47:58 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-05 10:57:36 -0500
commit39b796f28c7b42cbecdba56612b5f9c505572f07 (patch)
tree87db2934c17c74c2508b71fb381722f293d7a1d7 /memory.c
parent9510a486381c073a98d96db85b1102313fea9e03 (diff)
downloadqemu-39b796f28c7b42cbecdba56612b5f9c505572f07.zip
qemu-39b796f28c7b42cbecdba56612b5f9c505572f07.tar.gz
qemu-39b796f28c7b42cbecdba56612b5f9c505572f07.tar.bz2
memory: synchronize dirty bitmap before unmapping a range
When a range is being unmapped, ask accelerators (e.g. kvm) to synchronize the dirty bitmap to avoid losing information forever. Fixes grub2 screen update. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 5c6e63d..5f20320 100644
--- a/memory.c
+++ b/memory.c
@@ -245,6 +245,10 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
static void as_memory_range_del(AddressSpace *as, FlatRange *fr)
{
+ if (fr->dirty_log_mask) {
+ cpu_physical_sync_dirty_bitmap(fr->addr.start,
+ fr->addr.start + fr->addr.size);
+ }
cpu_register_physical_memory(fr->addr.start, fr->addr.size,
IO_MEM_UNASSIGNED);
}