summaryrefslogtreecommitdiffstats
path: root/include/linux/compiler-gcc.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-28 11:16:41 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-05-28 11:16:41 +0800
commit6d7e3d89954af773c70948a54cfa2aaa15907c1c (patch)
tree6908f5e0e1af7294c00dc4e06ed583ef62f594df /include/linux/compiler-gcc.h
parentd725332208ef13241fc435eece790c9d0ea16a4e (diff)
parentf858c7bcca8c20761a20593439fe998b4b67e86b (diff)
downloadop-kernel-dev-6d7e3d89954af773c70948a54cfa2aaa15907c1c.zip
op-kernel-dev-6d7e3d89954af773c70948a54cfa2aaa15907c1c.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree for 4.1 to pull in the changeset that disables algif_aead.
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r--include/linux/compiler-gcc.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index cdf13ca..371e560 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -9,10 +9,24 @@
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
-
/* Optimization barrier */
+
/* The "volatile" is due to gcc bugs */
#define barrier() __asm__ __volatile__("": : :"memory")
+/*
+ * This version is i.e. to prevent dead stores elimination on @ptr
+ * where gcc and llvm may behave differently when otherwise using
+ * normal barrier(): while gcc behavior gets along with a normal
+ * barrier(), llvm needs an explicit input variable to be assumed
+ * clobbered. The issue is as follows: while the inline asm might
+ * access any memory it wants, the compiler could have fit all of
+ * @ptr into memory registers instead, and since @ptr never escaped
+ * from that, it proofed that the inline asm wasn't touching any of
+ * it. This version works well with both compilers, i.e. we're telling
+ * the compiler that the inline asm absolutely may see the contents
+ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
+ */
+#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
/*
* This macro obfuscates arithmetic on a variable address so that gcc
OpenPOWER on IntegriCloud