From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0tuN-0005Xl-NC for qemu-devel@nongnu.org; Mon, 04 May 2009 04:52:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0tuI-0005TB-MX for qemu-devel@nongnu.org; Mon, 04 May 2009 04:52:18 -0400 Received: from [199.232.76.173] (port=35886 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0tuI-0005Sx-Hk for qemu-devel@nongnu.org; Mon, 04 May 2009 04:52:14 -0400 Received: from lizzard.sbs.de ([194.138.37.39]:22062) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M0tuG-00008x-Hm for qemu-devel@nongnu.org; Mon, 04 May 2009 04:52:14 -0400 Message-ID: <49FEACB4.7020208@siemens.com> Date: Mon, 04 May 2009 10:52:04 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20090501211717.24514.23246.stgit@mchn012c.ww002.siemens.net> <20090501211720.24514.67620.stgit@mchn012c.ww002.siemens.net> <49FD6C67.8000107@redhat.com> In-Reply-To: <49FD6C67.8000107@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 4/8] kvm: Rework dirty bitmap synchronization List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Anthony Liguori , qemu-devel@nongnu.org Avi Kivity wrote: > Jan Kiszka wrote: >> Extend kvm_physical_sync_dirty_bitmap() so that is can sync across >> multiple slots. Useful for updating the whole dirty log during >> migration. Moreover, properly pass down errors the whole call chain. >> >> >> -void cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, >> target_phys_addr_t end_addr); >> +int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, >> + target_phys_addr_t end_addr); >> >> > > This is defined in terms of physical addresses, but in patch 5, you > >> @@ -3248,13 +3248,18 @@ static int ram_save_live(QEMUFile *f, int >> stage, void *opaque) >> { >> ram_addr_t addr; >> >> + if (cpu_physical_sync_dirty_bitmap(0, last_ram_offset) != 0) { >> + qemu_file_set_error(f); >> + return 0; >> + } >> + >> > > Which is in terms of ram addresses; so this will fail with large memory, > where the last phys address is larger than the last ram address. True, will fix. > > Maybe this can be as easy as passing -1 for the end address. But in > this case I suggest adding a helper to sync all of memory instead. IMHO, defining a separate helper is overkill as it would also mean providing a specialized version of kvm_physical_sync_dirty_bitmap. I think I will go for TARGET_PHYS_ADDR_MAX. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux