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 02/17] xen: arm32: resync bitops with Linux v3.14-rc7
Date: Thu, 20 Mar 2014 17:13:47 +0000	[thread overview]
Message-ID: <532B21CB.2050002@linaro.org> (raw)
In-Reply-To: <1395330365-9901-2-git-send-email-ian.campbell@citrix.com>

On 03/20/2014 03:45 PM, Ian Campbell wrote:
> This pulls in the following Linux commits:
> 
> commit c36ef4b1762302a493c6cb754073bded084700e2
> Author: Will Deacon <will.deacon@arm.com>
> Date:   Wed Nov 23 11:28:25 2011 +0100
> 
>     ARM: 7171/1: unwind: add unwind directives to bitops assembly macros
> 
>     The bitops functions (e.g. _test_and_set_bit) on ARM do not have unwind
>     annotations and therefore the kernel cannot backtrace out of them on a
>     fatal error (for example, NULL pointer dereference).
> 
>     This patch annotates the bitops assembly macros with UNWIND annotations
>     so that we can produce a meaningful backtrace on error. Callers of the
>     macros are modified to pass their function name as a macro parameter,
>     enforcing that the macros are used as standalone function implementations.
> 
>     Acked-by: Dave Martin <dave.martin@linaro.org>
>     Signed-off-by: Will Deacon <will.deacon@arm.com>
>     Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> commit d779c07dd72098a7416d907494f958213b7726f3
> Author: Will Deacon <will.deacon@arm.com>
> Date:   Thu Jun 27 12:01:51 2013 +0100
> 
>     ARM: bitops: prefetch the destination word for write prior to strex
> 
>     The cost of changing a cacheline from shared to exclusive state can be
>     significant, especially when this is triggered by an exclusive store,
>     since it may result in having to retry the transaction.
> 
>     This patch prefixes our atomic bitops implementation with prefetchw,
>     to try and grab the line in exclusive state from the start. The testop
>     macro is left alone, since the barrier semantics limit the usefulness
>     of prefetching data.
> 
>     Acked-by: Nicolas Pitre <nico@linaro.org>
>     Signed-off-by: Will Deacon <will.deacon@arm.com>
> 
> commit b7ec699405f55667caeb46d96229d75bf33a83ad
> Author: Will Deacon <will.deacon@arm.com>
> Date:   Tue Nov 19 15:46:11 2013 +0100
> 
>     ARM: 7893/1: bitops: only emit .arch_extension mp if CONFIG_SMP
> 
>     Uwe reported a build failure when targetting a NOMMU platform with my
>     recent prefetch changes:
> 
>       arch/arm/lib/changebit.S: Assembler messages:
>       arch/arm/lib/changebit.S:15: Error: architectural extension `mp' is
>                         not allowed for the current base architecture
> 
>     This is due to use of the .arch_extension mp directive immediately prior
>     to an ALT_SMP(...) instruction. Whilst the ALT_SMP macro will expand to
>     nothing if !CONFIG_SMP, gas will still choke on the directive.
> 
>     This patch fixes the issue by only emitting the sequence (including the
>     directive) if CONFIG_SMP=y.
> 
>     Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>     Signed-off-by: Will Deacon <will.deacon@arm.com>
>     Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>

> ---
>  xen/arch/arm/arm32/lib/bitops.h        |   17 +++++++++++++++--
>  xen/arch/arm/arm32/lib/changebit.S     |    4 +---
>  xen/arch/arm/arm32/lib/clearbit.S      |    4 +---
>  xen/arch/arm/arm32/lib/setbit.S        |    4 +---
>  xen/arch/arm/arm32/lib/testchangebit.S |    4 +---
>  xen/arch/arm/arm32/lib/testclearbit.S  |    4 +---
>  xen/arch/arm/arm32/lib/testsetbit.S    |    4 +---
>  7 files changed, 21 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/lib/bitops.h b/xen/arch/arm/arm32/lib/bitops.h
> index 689f2e8..25784c3 100644
> --- a/xen/arch/arm/arm32/lib/bitops.h
> +++ b/xen/arch/arm/arm32/lib/bitops.h
> @@ -1,13 +1,20 @@
>  #include <xen/config.h>
>  
>  #if __LINUX_ARM_ARCH__ >= 6
> -	.macro	bitop, instr
> +	.macro	bitop, name, instr
> +ENTRY(	\name		)
> +UNWIND(	.fnstart	)
>  	ands	ip, r1, #3
>  	strneb	r1, [ip]		@ assert word-aligned
>  	mov	r2, #1
>  	and	r3, r0, #31		@ Get bit offset
>  	mov	r0, r0, lsr #5
>  	add	r1, r1, r0, lsl #2	@ Get word offset
> +#if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
> +	.arch_extension	mp
> +	ALT_SMP(W(pldw)	[r1])
> +	ALT_UP(W(nop))
> +#endif
>  	mov	r3, r2, lsl r3
>  1:	ldrex	r2, [r1]
>  	\instr	r2, r2, r3
> @@ -15,9 +22,13 @@
>  	cmp	r0, #0
>  	bne	1b
>  	bx	lr
> +UNWIND(	.fnend		)
> +ENDPROC(\name		)
>  	.endm
>  
> -	.macro	testop, instr, store
> +	.macro	testop, name, instr, store
> +ENTRY(	\name		)
> +UNWIND(	.fnstart	)
>  	ands	ip, r1, #3
>  	strneb	r1, [ip]		@ assert word-aligned
>  	mov	r2, #1
> @@ -36,6 +47,8 @@
>  	cmp	r0, #0
>  	movne	r0, #1
>  2:	bx	lr
> +UNWIND(	.fnend		)
> +ENDPROC(\name		)
>  	.endm
>  #else
>  	.macro	bitop, name, instr
> diff --git a/xen/arch/arm/arm32/lib/changebit.S b/xen/arch/arm/arm32/lib/changebit.S
> index 62954bc..11f41d2 100644
> --- a/xen/arch/arm/arm32/lib/changebit.S
> +++ b/xen/arch/arm/arm32/lib/changebit.S
> @@ -13,6 +13,4 @@
>  #include "bitops.h"
>                  .text
>  fined(CONFIG_SMP)
> -ENTRY(_change_bit)
> -	bitop	eor
> -ENDPROC(_change_bit)
> +bitop	_change_bit, eor
> diff --git a/xen/arch/arm/arm32/lib/clearbit.S b/xen/arch/arm/arm32/lib/clearbit.S
> index 42ce416..1b6a569 100644
> --- a/xen/arch/arm/arm32/lib/clearbit.S
> +++ b/xen/arch/arm/arm32/lib/clearbit.S
> @@ -14,6 +14,4 @@
>  #include "bitops.h"
>                  .text
>  
> -ENTRY(_clear_bit)
> -	bitop	bic
> -ENDPROC(_clear_bit)
> +bitop	_clear_bit, bic
> diff --git a/xen/arch/arm/arm32/lib/setbit.S b/xen/arch/arm/arm32/lib/setbit.S
> index c828851..1f4ef56 100644
> --- a/xen/arch/arm/arm32/lib/setbit.S
> +++ b/xen/arch/arm/arm32/lib/setbit.S
> @@ -13,6 +13,4 @@
>  #include "bitops.h"
>  	.text
>  
> -ENTRY(_set_bit)
> -	bitop	orr
> -ENDPROC(_set_bit)
> +bitop	_set_bit, orr
> diff --git a/xen/arch/arm/arm32/lib/testchangebit.S b/xen/arch/arm/arm32/lib/testchangebit.S
> index a7f527c..7f4635c 100644
> --- a/xen/arch/arm/arm32/lib/testchangebit.S
> +++ b/xen/arch/arm/arm32/lib/testchangebit.S
> @@ -13,6 +13,4 @@
>  #include "bitops.h"
>                  .text
>  
> -ENTRY(_test_and_change_bit)
> -	testop	eor, str
> -ENDPROC(_test_and_change_bit)
> +testop	_test_and_change_bit, eor, str
> diff --git a/xen/arch/arm/arm32/lib/testclearbit.S b/xen/arch/arm/arm32/lib/testclearbit.S
> index 8f39c72..4d4152f 100644
> --- a/xen/arch/arm/arm32/lib/testclearbit.S
> +++ b/xen/arch/arm/arm32/lib/testclearbit.S
> @@ -13,6 +13,4 @@
>  #include "bitops.h"
>                  .text
>  
> -ENTRY(_test_and_clear_bit)
> -	testop	bicne, strne
> -ENDPROC(_test_and_clear_bit)
> +testop	_test_and_clear_bit, bicne, strne
> diff --git a/xen/arch/arm/arm32/lib/testsetbit.S b/xen/arch/arm/arm32/lib/testsetbit.S
> index 1b8d273..54f48f9 100644
> --- a/xen/arch/arm/arm32/lib/testsetbit.S
> +++ b/xen/arch/arm/arm32/lib/testsetbit.S
> @@ -13,6 +13,4 @@
>  #include "bitops.h"
>                  .text
>  
> -ENTRY(_test_and_set_bit)
> -	testop	orreq, streq
> -ENDPROC(_test_and_set_bit)
> +testop	_test_and_set_bit, orreq, streq
> 


-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2014-03-20 17:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20 15:45 [PATCH 00/17] xen: arm: resync low level asm primitive from Linux Ian Campbell
2014-03-20 15:45 ` [PATCH 01/17] xen: x86 & generic: change to __builtin_prefetch() Ian Campbell
2014-03-20 16:12   ` Jan Beulich
2014-03-20 15:45 ` [PATCH 02/17] xen: arm32: resync bitops with Linux v3.14-rc7 Ian Campbell
2014-03-20 17:13   ` Julien Grall [this message]
2014-03-20 15:45 ` [PATCH 03/17] xen: arm32: ensure cmpxchg has full barrier semantics Ian Campbell
2014-03-20 17:22   ` Julien Grall
2014-03-20 15:45 ` [PATCH 04/17] xen: arm32: replace hard tabs in atomics.h Ian Campbell
2014-03-20 17:23   ` Julien Grall
2014-03-20 15:45 ` [PATCH 05/17] xen: arm32: resync atomics with (almost) v3.14-rc7 Ian Campbell
2014-03-20 17:27   ` Julien Grall
2014-03-21  8:41     ` Ian Campbell
2014-03-20 15:45 ` [PATCH 06/17] xen: arm32: resync mem* with Linux v3.14-rc7 Ian Campbell
2014-03-20 17:29   ` Julien Grall
2014-03-20 15:45 ` [PATCH 07/17] xen: arm32: add optimised memchr routine Ian Campbell
2014-03-20 17:32   ` Julien Grall
2014-03-20 15:45 ` [PATCH 08/17] xen: arm32: add optimised strchr and strrchr routines Ian Campbell
2014-03-20 17:33   ` Julien Grall
2014-03-20 15:45 ` [PATCH 09/17] xen: arm: remove atomic_clear_mask() Ian Campbell
2014-03-20 17:35   ` Julien Grall
2014-03-20 15:45 ` [PATCH 10/17] xen: arm64: disable alignment traps Ian Campbell
2014-03-20 15:57   ` Andrew Cooper
2014-03-20 15:59     ` Ian Campbell
2014-03-20 16:21       ` Gordan Bobic
2014-03-20 16:27         ` Ian Campbell
2014-03-20 16:43           ` Gordan Bobic
2014-03-20 16:54             ` Ian Campbell
2014-03-20 17:54   ` Julien Grall
2014-03-20 15:45 ` [PATCH 11/17] xen: arm64: atomics: fix use of acquire + release for full barrier semantics Ian Campbell
2014-03-20 17:43   ` Julien Grall
2014-03-20 15:46 ` [PATCH 12/17] xen: arm64: reinstate hard tabs in system.h cmpxchg Ian Campbell
2014-03-20 17:44   ` Julien Grall
2014-03-20 15:46 ` [PATCH 13/17] xen: arm64: asm: remove redundant "cc" clobbers Ian Campbell
2014-03-20 17:45   ` Julien Grall
2014-03-20 15:46 ` [PATCH 14/17] xen: arm64: assembly optimised mem* and str* Ian Campbell
2014-03-20 17:48   ` Julien Grall
2014-03-20 15:46 ` [PATCH 15/17] xen: arm64: optimised clear_page Ian Campbell
2014-03-20 15:46 ` [PATCH 16/17] xen: arm: refactor xchg and cmpxchg into their own headers Ian Campbell
2014-03-20 17:52   ` Julien Grall
2014-03-21  8:42     ` Ian Campbell
2014-03-20 15:46 ` [PATCH 17/17] xen: arm: document what low level primitives we have imported from Linux Ian Campbell
2014-03-20 16:23   ` 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=532B21CB.2050002@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.