From patchwork Wed May 13 19:21:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 23584 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4DJLqJS006205 for ; Wed, 13 May 2009 19:21:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760589AbZEMTVR (ORCPT ); Wed, 13 May 2009 15:21:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760574AbZEMTVR (ORCPT ); Wed, 13 May 2009 15:21:17 -0400 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 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4DJLG5Q026936; Wed, 13 May 2009 15:21:16 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4DJLFI5007618; Wed, 13 May 2009 15:21:15 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com 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> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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;