From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8wdS-0002qV-S6 for qemu-devel@nongnu.org; Mon, 12 Aug 2013 14:14:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8wdM-0000i8-Ru for qemu-devel@nongnu.org; Mon, 12 Aug 2013 14:14:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8wdM-0000hw-L2 for qemu-devel@nongnu.org; Mon, 12 Aug 2013 14:14:24 -0400 Date: Mon, 12 Aug 2013 21:15:59 +0300 From: "Michael S. Tsirkin" Message-ID: <1376310634-20778-2-git-send-email-mst@redhat.com> References: <1376310634-20778-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1376310634-20778-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH v2 for-1.6 v2 1/2] memory: export migration page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Laszlo Ersek , Gerd Hoffmann , pbonzini@redhat.com Migration code assumes that each RAM block is a multiple of target page size. We can fix this in a variety of ways, for 1.6 the simplest way is possibly exporting the required page size so callers can make regions large enough. Signed-off-by: Michael S. Tsirkin --- arch_init.c | 3 +++ include/exec/memory.h | 1 + 2 files changed, 4 insertions(+) diff --git a/arch_init.c b/arch_init.c index 68a7ab7..61937e2 100644 --- a/arch_init.c +++ b/arch_init.c @@ -150,6 +150,9 @@ int qemu_read_default_config_files(bool userconfig) return 0; } +/* Smallest page size for migrated RAM. */ +uint64_t qemu_migration_page_size = TARGET_PAGE_SIZE; + static inline bool is_zero_page(uint8_t *p) { return buffer_find_nonzero_offset(p, TARGET_PAGE_SIZE) == diff --git a/include/exec/memory.h b/include/exec/memory.h index ebe0d24..42450fe 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1055,6 +1055,7 @@ void *address_space_map(AddressSpace *as, hwaddr addr, void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len, int is_write, hwaddr access_len); +extern uint64_t qemu_migration_page_size; #endif -- MST