From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT6uY-0007K7-KV for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:15:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT6uS-0003Yh-Db for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:15:30 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:57150 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT6uS-0003YY-7F for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:15:24 -0400 Message-ID: <52527BAA.3000302@dlhnet.de> Date: Mon, 07 Oct 2013 11:15:22 +0200 From: Peter Lieven MIME-Version: 1.0 References: <1380024203-25897-1-git-send-email-quintela@redhat.com> <1380024203-25897-9-git-send-email-quintela@redhat.com> In-Reply-To: <1380024203-25897-9-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 8/9] arch_init: make is_zero_page accept size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: Isaku Yamahata , anthony@codemonkey.ws On 24.09.2013 14:03, Juan Quintela wrote: > From: Isaku Yamahata > > Later is_zero_page will be used for non TARGET_PAGE_SIZE > range. > And rename it to is_zero_range as it isn't page size any more. > > Signed-off-by: Isaku Yamahata > Signed-off-by: Juan Quintela > --- > arch_init.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index 18cd9a1..c72790f 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -150,10 +150,9 @@ int qemu_read_default_config_files(bool userconfig) > return 0; > } > > -static inline bool is_zero_page(uint8_t *p) > +static inline bool is_zero_range(uint8_t *p, uint64_t size) > { > - return buffer_find_nonzero_offset(p, TARGET_PAGE_SIZE) == > - TARGET_PAGE_SIZE; > + return buffer_find_nonzero_offset(p, size) == size; > } this is buffer_is_zero(p, size); maybe this function should be used. Peter