From: Glauber Costa Subject: [PATCH] don't use a 32-bit bit type as offset argument. Date: Wed, 13 May 2009 15:21:14 -0400 Message-ID: <1242242474-7599-1-git-send-email-glommer@redhat.com> Cc: avi@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39897 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760150AbZEMTVQ (ORCPT ); Wed, 13 May 2009 15:21:16 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4DJLHrY028637 for ; Wed, 13 May 2009 15:21:17 -0400 Sender: kvm-owner@vger.kernel.org List-ID: In the call path of kvm_get_dirty_pages_log_range(), its caller kvm_get_dirty_bitmap_cb() passes the target_phys_addr_t both as start_addr and the offset. So, using int will make dirty tracking over 4G fail completely. Of course we should be using qemu types in here, so please don't get me started on this. The whole file is wrong already ;) Signed-off-by: Glauber Costa --- qemu-kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index f55cee8..27c37b5 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1201,7 +1201,7 @@ int kvm_physical_memory_set_dirty_tracking(int enable) /* get kvm's dirty pages bitmap and update qemu's */ static int kvm_get_dirty_pages_log_range(unsigned long start_addr, unsigned char *bitmap, - unsigned int offset, + unsigned long offset, unsigned long mem_size) { unsigned int i, j, n=0; -- 1.5.6.6