From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdsnC-0006oU-1n for qemu-devel@nongnu.org; Thu, 22 Dec 2011 19:15:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdsnA-0005CF-Ta for qemu-devel@nongnu.org; Thu, 22 Dec 2011 19:15:22 -0500 Received: from gate.crashing.org ([63.228.1.57]:41053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdsnA-0005Be-CK for qemu-devel@nongnu.org; Thu, 22 Dec 2011 19:15:20 -0500 Message-ID: <1324599306.6632.13.camel@pasglop> From: Benjamin Herrenschmidt Date: Fri, 23 Dec 2011 11:15:06 +1100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Subject: [Qemu-devel] [PATCH] Fix KVM dirty logging with 32-bit qemu & >32-bit physical addresses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Avi Kivity , Alexander Graf , David Gibson We were using the wrong types in kvm_get_dirty_pages_log_range(). This would break dirty logging if the region to log resides at a physical address above 32-bit, which can happen with 64-bit guest but also with 32-bit guests that support >32-bit physical addresses such as ppc BookE. Signed-off-by: Benjamin Herrenschmidt --- kvm-all.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 4c466d6..91b0694 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -328,13 +328,14 @@ static int kvm_set_migration_log(int enable) } /* get kvm's dirty pages bitmap and update qemu's */ -static int kvm_get_dirty_pages_log_range(unsigned long start_addr, +static int kvm_get_dirty_pages_log_range(target_phys_addr_t start_addr, unsigned long *bitmap, - unsigned long offset, + target_phys_addr_t offset, unsigned long mem_size) { unsigned int i, j; - unsigned long page_number, addr, addr1, c; + unsigned long page_number, c; + target_phys_addr_t addr, addr1; ram_addr_t ram_addr; unsigned int len = ((mem_size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;