From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrpwG-0001vY-RY for qemu-devel@nongnu.org; Thu, 19 Jul 2012 08:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Srpw9-0004jj-Su for qemu-devel@nongnu.org; Thu, 19 Jul 2012 08:34:40 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:38777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srpw9-0004je-MI for qemu-devel@nongnu.org; Thu, 19 Jul 2012 08:34:33 -0400 Received: by pbbro12 with SMTP id ro12so4335000pbb.4 for ; Thu, 19 Jul 2012 05:34:32 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5007FECE.9090305@redhat.com> Date: Thu, 19 Jul 2012 14:34:22 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1342531805-29894-1-git-send-email-anthony.perard@citrix.com> <1342531805-29894-4-git-send-email-anthony.perard@citrix.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [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: Stefano Stabellini Cc: Anthony Liguori , QEMU-devel , Xen Devel , Avi Kivity , Anthony PERARD , Luiz Capitulino Il 17/07/2012 20:06, Stefano Stabellini ha scritto: > On Tue, 17 Jul 2012, Anthony PERARD wrote: >> 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; > > You need to add xen_modified_memory in cpu_physical_memory_map, rather > than cpu_physical_memory_unmap. No, adding it to map is wrong, because the RAM save routine can migrate (and mark as non-dirty) the read buffers _before_ the device models have written to them. Paolo