All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH v3 15/17] xen: arm64: optimised clear_page
Date: Wed, 02 Apr 2014 17:26:11 +0100	[thread overview]
Message-ID: <533C3A23.10600@linaro.org> (raw)
In-Reply-To: <1396455795.4211.7.camel@kazak.uk.xensource.com>

On 04/02/2014 05:23 PM, Ian Campbell wrote:
> 
>>> +#ifdef CONFIG_ARM_32
>>> +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
>>> +#else
>>> +extern void clear_page(void *to);
>>> +#endif
>>> +
>>
>> I would prefer if you move the defined in arm{32,64}/page.h.
> 
> Ack. Just resending this one:

Thanks!

> ------------<8------------------
> 
> 
> From f679cbc3a191c43aa303b4e74f241e8755430ba0 Mon Sep 17 00:00:00 2001
> From: Ian Campbell <ian.campbell@citrix.com>
> Date: Wed, 19 Mar 2014 17:19:56 +0000
> Subject: [PATCH] xen: arm64: optimised clear_page
> 
> Taken from Linux v3.14-rc7.
> 
> The clear_page header now needs to be within the !__ASSEMBLY__
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
> ---
> v3: Move prototypes to arm{32,64}/page.h
> ---
>  xen/arch/arm/arm64/lib/Makefile     |    1 +
>  xen/arch/arm/arm64/lib/clear_page.S |   36 +++++++++++++++++++++++++++++++++++
>  xen/include/asm-arm/arm32/page.h    |    2 ++
>  xen/include/asm-arm/arm64/page.h    |    2 ++
>  xen/include/asm-arm/page.h          |    2 --
>  5 files changed, 41 insertions(+), 2 deletions(-)
>  create mode 100644 xen/arch/arm/arm64/lib/clear_page.S
> 
> diff --git a/xen/arch/arm/arm64/lib/Makefile b/xen/arch/arm/arm64/lib/Makefile
> index 9f3b236..b895afa 100644
> --- a/xen/arch/arm/arm64/lib/Makefile
> +++ b/xen/arch/arm/arm64/lib/Makefile
> @@ -1,3 +1,4 @@
>  obj-y += memcpy.o memmove.o memset.o memchr.o
> +obj-y += clear_page.o
>  obj-y += bitops.o find_next_bit.o
>  obj-y += strchr.o strrchr.o
> diff --git a/xen/arch/arm/arm64/lib/clear_page.S b/xen/arch/arm/arm64/lib/clear_page.S
> new file mode 100644
> index 0000000..8d5cadb
> --- /dev/null
> +++ b/xen/arch/arm/arm64/lib/clear_page.S
> @@ -0,0 +1,36 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <xen/config.h>
> +
> +/*
> + * Clear page @dest
> + *
> + * Parameters:
> + *	x0 - dest
> + */
> +ENTRY(clear_page)
> +	mrs	x1, dczid_el0
> +	and	w1, w1, #0xf
> +	mov	x2, #4
> +	lsl	x1, x2, x1
> +
> +1:	dc	zva, x0
> +	add	x0, x0, x1
> +	tst	x0, #(PAGE_SIZE - 1)
> +	b.ne	1b
> +	ret
> +ENDPROC(clear_page)
> diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
> index 191a108..a4c1a1a 100644
> --- a/xen/include/asm-arm/arm32/page.h
> +++ b/xen/include/asm-arm/arm32/page.h
> @@ -111,6 +111,8 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va)
>      return par;
>  }
>  
> +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
> +
>  #endif /* __ASSEMBLY__ */
>  
>  #endif /* __ARM_ARM32_PAGE_H__ */
> diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
> index 20b4c5a..91e1914 100644
> --- a/xen/include/asm-arm/arm64/page.h
> +++ b/xen/include/asm-arm/arm64/page.h
> @@ -105,6 +105,8 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va)
>      return par;
>  }
>  
> +extern void clear_page(void *to);
> +
>  #endif /* __ASSEMBLY__ */
>  
>  #endif /* __ARM_ARM64_PAGE_H__ */
> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index d18ec2a..c77ba85 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -382,8 +382,6 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr)
>  #define third_table_offset(va)  TABLE_OFFSET(third_linear_offset(va))
>  #define zeroeth_table_offset(va)  TABLE_OFFSET(zeroeth_linear_offset(va))
>  
> -#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
> -
>  #define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK)
>  
>  #endif /* __ARM_PAGE_H__ */
> 


-- 
Julien Grall

  reply	other threads:[~2014-04-02 16:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26 13:36 [PATCH v2 00/17] xen: arm: resync low level asm primitive from Linux Ian Campbell
2014-03-26 13:38 ` [PATCH v2 01/17] xen: x86 & generic: change to __builtin_prefetch() Ian Campbell
2014-04-02 16:01   ` Ian Campbell
2014-03-26 13:38 ` [PATCH v2 02/17] xen: arm32: resync bitops with Linux v3.14-rc7 Ian Campbell
2014-03-26 13:38 ` [PATCH v2 03/17] xen: arm32: ensure cmpxchg has full barrier semantics Ian Campbell
2014-03-26 13:38 ` [PATCH v2 04/17] xen: arm32: replace hard tabs in atomics.h Ian Campbell
2014-03-26 13:38 ` [PATCH v2 05/17] xen: arm32: resync atomics with (almost) v3.14-rc7 Ian Campbell
2014-03-26 14:10   ` Julien Grall
2014-03-26 13:38 ` [PATCH v2 06/17] xen: arm32: resync mem* with Linux v3.14-rc7 Ian Campbell
2014-03-26 13:38 ` [PATCH v2 07/17] xen: arm32: add optimised memchr routine Ian Campbell
2014-03-26 13:38 ` [PATCH v2 08/17] xen: arm32: add optimised strchr and strrchr routines Ian Campbell
2014-03-26 13:38 ` [PATCH v2 09/17] xen: arm: remove atomic_clear_mask() Ian Campbell
2014-03-26 13:38 ` [PATCH v2 10/17] xen: arm64: disable alignment traps Ian Campbell
2014-03-26 13:38 ` [PATCH v2 11/17] xen: arm64: atomics: fix use of acquire + release for full barrier semantics Ian Campbell
2014-03-26 13:38 ` [PATCH v2 12/17] xen: arm64: reinstate hard tabs in system.h cmpxchg Ian Campbell
2014-03-26 13:38 ` [PATCH v2 13/17] xen: arm64: asm: remove redundant "cc" clobbers Ian Campbell
2014-03-26 13:38 ` [PATCH v2 14/17] xen: arm64: assembly optimised mem* and str* Ian Campbell
2014-03-26 13:38 ` [PATCH v2 15/17] xen: arm64: optimised clear_page Ian Campbell
2014-03-26 14:16   ` Julien Grall
2014-04-02 16:23     ` [PATCH v3 " Ian Campbell
2014-04-02 16:26       ` Julien Grall [this message]
2014-03-26 13:38 ` [PATCH v2 16/17] xen: arm: refactor xchg and cmpxchg into their own headers Ian Campbell
2014-03-26 14:18   ` Julien Grall
2014-03-26 13:38 ` [PATCH v2 17/17] xen: arm: document what low level primitives we have imported from Linux Ian Campbell
2014-03-26 14:20   ` Julien Grall
2014-03-27 16:59 ` [PATCH v2 00/17] xen: arm: resync low level asm primitive " Tim Deegan
2014-03-27 17:02   ` Ian Campbell
2014-03-27 17:04     ` Tim Deegan
2014-03-27 17:18       ` Ian Campbell
2014-03-28 18:00         ` Julien Grall
2014-04-03 16:32 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533C3A23.10600@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.