From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTyJO-00078d-0C for qemu-devel@nongnu.org; Wed, 09 Oct 2013 14:16:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTyJE-0004yI-Rt for qemu-devel@nongnu.org; Wed, 09 Oct 2013 14:16:41 -0400 Received: from mail-vb0-x22a.google.com ([2607:f8b0:400c:c02::22a]:48195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTyJE-0004y1-NJ for qemu-devel@nongnu.org; Wed, 09 Oct 2013 14:16:32 -0400 Received: by mail-vb0-f42.google.com with SMTP id e12so818381vbg.1 for ; Wed, 09 Oct 2013 11:16:31 -0700 (PDT) Sender: Richard Henderson Message-ID: <52559D76.4080601@twiddle.net> Date: Wed, 09 Oct 2013 11:16:22 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1381318130-10620-1-git-send-email-quintela@redhat.com> <1381318130-10620-29-git-send-email-quintela@redhat.com> In-Reply-To: <1381318130-10620-29-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 28/28] memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: chegu_vinod@hp.com, qemu-devel@nongnu.org On 10/09/2013 04:28 AM, Juan Quintela wrote: > We were clearing a range of bits, so use bitmap_set(). Comment is slightly wrong. ;-) > > Signed-off-by: Juan Quintela > --- > include/exec/memory-internal.h | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h > index 2f704e8..d46570e 100644 > --- a/include/exec/memory-internal.h > +++ b/include/exec/memory-internal.h > @@ -95,13 +95,11 @@ static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start, > ram_addr_t length, > unsigned client) > { > - ram_addr_t addr, end; > + unsigned long end, page; > > - end = TARGET_PAGE_ALIGN(start + length); > - start &= TARGET_PAGE_MASK; > - for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) { > - clear_bit(addr >> TARGET_PAGE_BITS, ram_list.dirty_memory[client]); > - } > + end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS; > + page = start >> TARGET_PAGE_BITS; > + bitmap_clear(ram_list.dirty_memory[client], page, end - page);