From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2MEm-0000vF-DS for qemu-devel@nongnu.org; Tue, 28 Feb 2012 07:33:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2MEf-000529-QL for qemu-devel@nongnu.org; Tue, 28 Feb 2012 07:32:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2MEf-00051r-IR for qemu-devel@nongnu.org; Tue, 28 Feb 2012 07:32:53 -0500 Message-ID: <4F4CC96B.6040003@redhat.com> Date: Tue, 28 Feb 2012 14:32:43 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1330043012-30556-1-git-send-email-david@gibson.dropbear.id.au> <1330043012-30556-7-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1330043012-30556-7-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/6] kvm: Fix dirty tracking with large kernel page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Marcelo Tosatti , qemu-devel@nongnu.org, anthony@codemonkey.ws On 02/24/2012 02:23 AM, David Gibson wrote: > From: Benjamin Herrenschmidt > > If the kernel page size is larger than TARGET_PAGE_SIZE, which > happens for example on ppc64 with kernels compiled for 64K pages, > the dirty tracking doesn't work. > > Cc: Avi Kivity > Cc: Marcelo Tossatti > > Signed-off-by: Benjamin Herrenschmidt > Signed-off-by: David Gibson > --- > kvm-all.c | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/kvm-all.c b/kvm-all.c > index 5e188bf..3f8cfd9 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -348,10 +348,11 @@ static int kvm_set_migration_log(int enable) > static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section, > unsigned long *bitmap) > { > - unsigned int i, j; > + unsigned int i, j; > unsigned long page_number, c; > target_phys_addr_t addr, addr1; > unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS; > + unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE; > > What if TARGET_PAGE_SIZE > getpagesize()? Or is that impossible? -- error compiling committee.c: too many arguments to function