diff mbox

[Xen-devel] xen: arm: use more specific barriers for read and write barriers.

Message ID 1395067960-23225-1-git-send-email-ian.campbell@citrix.com
State Superseded
Headers show

Commit Message

Ian Campbell March 17, 2014, 2:52 p.m. UTC
Note that 32-bit does not provide a load variant of the inner shareable
barrier, so that remains a full any-any barrier.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-arm/system.h |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Comments

Ian Campbell March 17, 2014, 2:53 p.m. UTC | #1
I pressed Up+Enter in the wrong window. please ignore.

On Mon, 2014-03-17 at 14:52 +0000, Ian Campbell wrote:
> Note that 32-bit does not provide a load variant of the inner shareable
> barrier, so that remains a full any-any barrier.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Acked-by: Tim Deegan <tim@xen.org>
> ---
>  xen/include/asm-arm/system.h |   17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
> index 32ed277..7aaaf50 100644
> --- a/xen/include/asm-arm/system.h
> +++ b/xen/include/asm-arm/system.h
> @@ -17,12 +17,21 @@
>  #define dmb(scope)      asm volatile("dmb " #scope : : : "memory")
>  
>  #define mb()            dsb(sy)
> -#define rmb()           dsb(sy)
> -#define wmb()           dsb(sy)
> +#ifdef CONFIG_ARM_64
> +#define rmb()           dsb(ld)
> +#else
> +#define rmb()           dsb(sy) /* 32-bit has no ld variant. */
> +#endif
> +#define wmb()           dsb(st)
>  
>  #define smp_mb()        dmb(ish)
> -#define smp_rmb()       dmb(ish)
> -#define smp_wmb()       dmb(ish)
> +#ifdef CONFIG_ARM_64
> +#define smp_rmb()       dmb(ishld)
> +#else
> +#define smp_rmb()       dmb(ish) /* 32-bit has no ishld variant. */
> +#endif
> +
> +#define smp_wmb()       dmb(ishst)
>  
>  #define xchg(ptr,x) \
>          ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
diff mbox

Patch

diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index 32ed277..7aaaf50 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -17,12 +17,21 @@ 
 #define dmb(scope)      asm volatile("dmb " #scope : : : "memory")
 
 #define mb()            dsb(sy)
-#define rmb()           dsb(sy)
-#define wmb()           dsb(sy)
+#ifdef CONFIG_ARM_64
+#define rmb()           dsb(ld)
+#else
+#define rmb()           dsb(sy) /* 32-bit has no ld variant. */
+#endif
+#define wmb()           dsb(st)
 
 #define smp_mb()        dmb(ish)
-#define smp_rmb()       dmb(ish)
-#define smp_wmb()       dmb(ish)
+#ifdef CONFIG_ARM_64
+#define smp_rmb()       dmb(ishld)
+#else
+#define smp_rmb()       dmb(ish) /* 32-bit has no ishld variant. */
+#endif
+
+#define smp_wmb()       dmb(ishst)
 
 #define xchg(ptr,x) \
         ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))