summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJames Huang <jamehuang@nvidia.com>2018-02-01 13:01:50 +0800
committerWinnie Hsu <whsu@nvidia.com>2018-04-03 10:44:59 -0700
commit946ad0dedcd475c32e4c455d21c5c6df12caa6f7 (patch)
treec10b3a0ea2b39733f0f244238abcc7966febb304 /arch
parent68bd404adda3b13e3a5a465696ec85647f08dbdf (diff)
arm64: define speculation barrier
The instruction sequency "dsb sy" followed by "isb" functions as a speculation barrier, which prevents the instructions after that from being speculatively executed. bug 2039126 Change-Id: Ie3b7b873a12002617e60510ed8759bdaa7cd7057 Signed-off-by: Bo Yan <byan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1618222 Signed-off-by: James Huang <jamehuang@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1650093 Signed-off-by: Jeetesh Burman <jburman@nvidia.com> (cherry picked from commit f125c60045878513902cac4a084fde9a516eb3e2) Reviewed-on: https://git-master.nvidia.com/r/1660782 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/include/asm/barrier.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
index 9269edba2c90..8059ead5f2d6 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
@@ -99,6 +99,10 @@ do { \
#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
#define nop() asm volatile("nop");
+#define speculation_barrier() \
+ asm volatile( "dsb sy\n" \
+ "isb\n" : : : "memory")
+
#endif /* __ASSEMBLY__ */
#endif /* __ASM_BARRIER_H */