From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnbzZ-0002Ju-Fl for qemu-devel@nongnu.org; Sun, 31 Jul 2011 15:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnbzY-0000yB-ET for qemu-devel@nongnu.org; Sun, 31 Jul 2011 15:48:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnbzY-0000xz-7W for qemu-devel@nongnu.org; Sun, 31 Jul 2011 15:48:04 -0400 From: Avi Kivity Date: Sun, 31 Jul 2011 22:47:58 +0300 Message-Id: <1312141678-5141-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH] memory: synchronize dirty bitmap before unmapping a range List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org Cc: Jan Kiszka , kvm@vger.kernel.org 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 --- Please apply before the PCI batch to avoid bisectability issues (and don't pull, since that removes ordering). memory.c | 4 ++++ 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); } -- 1.7.5.3