From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8Pc4-0004O7-Td for qemu-devel@nongnu.org; Wed, 29 Jan 2014 02:31:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8Pby-0003mC-W8 for qemu-devel@nongnu.org; Wed, 29 Jan 2014 02:31:08 -0500 Received: from mail-ea0-x22f.google.com ([2a00:1450:4013:c01::22f]:62155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8Pby-0003lG-PL for qemu-devel@nongnu.org; Wed, 29 Jan 2014 02:31:02 -0500 Received: by mail-ea0-f175.google.com with SMTP id z10so690198ead.34 for ; Tue, 28 Jan 2014 23:31:01 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52E8AE32.7000200@redhat.com> Date: Wed, 29 Jan 2014 08:30:58 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1390974639-24880-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1390974639-24880-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Revert "memory: syncronize kvm bitmap using bitmaps operations" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: Orit Wasserman , Juan Quintela Il 29/01/2014 06:50, Alexey Kardashevskiy ha scritto: > Since 64K system page size is quite popular configuration on PPC64, > the original patch breaks migration. > > Signed-off-by: Alexey Kardashevskiy > --- > include/exec/ram_addr.h | 54 +++++++++++++++++-------------------------------- > 1 file changed, 18 insertions(+), 36 deletions(-) > > diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h > index 33c8acc..c6736ed 100644 > --- a/include/exec/ram_addr.h > +++ b/include/exec/ram_addr.h > @@ -83,47 +83,29 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, > ram_addr_t start, > ram_addr_t pages) > { > - unsigned long i, j; > + unsigned int i, j; > unsigned long page_number, c; > hwaddr addr; > ram_addr_t ram_addr; > - unsigned long len = (pages + HOST_LONG_BITS - 1) / HOST_LONG_BITS; > + unsigned int len = (pages + HOST_LONG_BITS - 1) / HOST_LONG_BITS; > unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE; > - unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS); > > - /* start address is aligned at the start of a word? */ > - if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) { Why not just add " && hpratio == 1" here? Paolo