From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr7rH-0002wZ-8U for qemu-devel@nongnu.org; Tue, 17 Jul 2012 09:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sr7r6-00037A-3v for qemu-devel@nongnu.org; Tue, 17 Jul 2012 09:30:35 -0400 Received: from smtp.citrix.com ([66.165.176.89]:2364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr7r5-00036o-Uz for qemu-devel@nongnu.org; Tue, 17 Jul 2012 09:30:24 -0400 From: Anthony PERARD Date: Tue, 17 Jul 2012 14:30:04 +0100 Message-ID: <1342531805-29894-4-git-send-email-anthony.perard@citrix.com> In-Reply-To: <1342531805-29894-1-git-send-email-anthony.perard@citrix.com> References: <1342531805-29894-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 3/4] exec, memory: Call to xen_modified_memory. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel Cc: Anthony Liguori , Xen Devel , Stefano Stabellini , Avi Kivity , Anthony PERARD , Luiz Capitulino This patch add some calls to xen_modified_memory to notify Xen about dirtybits during migration. Signed-off-by: Anthony PERARD --- exec.c | 4 ++++ memory.c | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index c9fa17d..9f7a4f7 100644 --- a/exec.c +++ b/exec.c @@ -3438,6 +3438,7 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, cpu_physical_memory_set_dirty_flags( addr1, (0xff & ~CODE_DIRTY_FLAG)); } + xen_modified_memory(addr1, TARGET_PAGE_SIZE); qemu_put_ram_ptr(ptr); } } else { @@ -3623,6 +3624,7 @@ void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len, if (buffer != bounce.buffer) { if (is_write) { ram_addr_t addr1 = qemu_ram_addr_from_host_nofail(buffer); + xen_modified_memory(addr1, access_len); while (access_len) { unsigned l; l = TARGET_PAGE_SIZE; @@ -3947,6 +3949,7 @@ static inline void stl_phys_internal(target_phys_addr_t addr, uint32_t val, cpu_physical_memory_set_dirty_flags(addr1, (0xff & ~CODE_DIRTY_FLAG)); } + xen_modified_memory(addr1, 4); } } @@ -4020,6 +4023,7 @@ static inline void stw_phys_internal(target_phys_addr_t addr, uint32_t val, cpu_physical_memory_set_dirty_flags(addr1, (0xff & ~CODE_DIRTY_FLAG)); } + xen_modified_memory(addr1, 2); } } diff --git a/memory.c b/memory.c index aab4a31..4d004e2 100644 --- a/memory.c +++ b/memory.c @@ -19,6 +19,7 @@ #include "bitops.h" #include "kvm.h" #include +#include "hw/xen.h" #define WANT_EXEC_OBSOLETE #include "exec-obsolete.h" @@ -1085,6 +1086,7 @@ void memory_region_set_dirty(MemoryRegion *mr, target_phys_addr_t addr, target_phys_addr_t size) { assert(mr->terminates); + xen_modified_memory(mr->ram_addr + addr, size); return cpu_physical_memory_set_dirty_range(mr->ram_addr + addr, size, -1); } -- Anthony PERARD