From 7fe7e9f353c3596b78b6bed1f4267037de750a48 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 5 Dec 2016 12:25:42 -0500 Subject: [PATCH] ARM32: use dmb ish (inner shareable domain) for smp barriers Based on https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01272.html: From: Ramana Radhakrishnan : "Hans Boehm pointed out that we were using dmb sy instead of dmb ish. Given that the ARM-ARM says that the inner shareability domain is really the one that contains all PE's controlled by a single hypervisor or operating system, it would be safe to replace all dmb sy's with dmb ish's. " Keep full system barriers for cmm_mb()/cmm_rmb()/cmm_wmb(). Signed-off-by: Mathieu Desnoyers --- include/urcu/arch/arm.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/urcu/arch/arm.h b/include/urcu/arch/arm.h index 5cbca7d..cb8f28d 100644 --- a/include/urcu/arch/arm.h +++ b/include/urcu/arch/arm.h @@ -31,9 +31,19 @@ extern "C" { #endif #ifdef CONFIG_RCU_ARM_HAVE_DMB -#define cmm_mb() __asm__ __volatile__ ("dmb":::"memory") -#define cmm_rmb() __asm__ __volatile__ ("dmb":::"memory") -#define cmm_wmb() __asm__ __volatile__ ("dmb":::"memory") +/* + * Issues full system DMB operation. + */ +#define cmm_mb() __asm__ __volatile__ ("dmb sy":::"memory") +#define cmm_rmb() __asm__ __volatile__ ("dmb sy":::"memory") +#define cmm_wmb() __asm__ __volatile__ ("dmb sy":::"memory") + +/* + * Issues DMB operation only to the inner shareable domain. + */ +#define cmm_smp_mb() __asm__ __volatile__ ("dmb ish":::"memory") +#define cmm_smp_rmb() __asm__ __volatile__ ("dmb ish":::"memory") +#define cmm_smp_wmb() __asm__ __volatile__ ("dmb ish":::"memory") #endif /* CONFIG_RCU_ARM_HAVE_DMB */ #include -- 2.34.1