From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr8SC-0008Ad-Go for qemu-devel@nongnu.org; Tue, 17 Jul 2012 10:08:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sr8SB-0005l7-8c for qemu-devel@nongnu.org; Tue, 17 Jul 2012 10:08:44 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:2801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr8SB-0005l1-36 for qemu-devel@nongnu.org; Tue, 17 Jul 2012 10:08:43 -0400 Message-ID: <50056FAB.8030404@citrix.com> Date: Tue, 17 Jul 2012 14:59:07 +0100 From: Anthony PERARD 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> <50056AA1.9010004@redhat.com> In-Reply-To: <50056AA1.9010004@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed 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: Avi Kivity Cc: Luiz Capitulino , Anthony Liguori , Stefano Stabellini , QEMU-devel , Xen Devel On 17/07/12 14:37, Avi Kivity wrote: > On 07/17/2012 04:30 PM, Anthony PERARD wrote: >> This patch add some calls to xen_modified_memory to notify Xen about dirtybits >> during migration. >> >> 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 { > > This is pretty ugly. An alternative is to set up a periodic bitmap scan > that looks at the qemu dirty bitmap and calls xen_modified_memory() for > dirty page ranges, and clears the bitmap for the next pass. Is it workable? I don't think a periodic scan can do anything useful, unfortunately. > (is xen_modified_memory a hypercall, or does it maintain an in-memory > structure?) It's an hypercall. The function do something (call the hypercall) only during migration, otherwise it return immediately. -- Anthony PERARD