+ include-linux-compilerh-add-version-detection-to-asm_volatile_goto.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: include/linux/compiler*.h: add version detection to asm_volatile_goto
has been added to the -mm tree.  Its filename is
     include-linux-compilerh-add-version-detection-to-asm_volatile_goto.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/include-linux-compilerh-add-version-detection-to-asm_volatile_goto.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/include-linux-compilerh-add-version-detection-to-asm_volatile_goto.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Subject: include/linux/compiler*.h: add version detection to asm_volatile_goto

The comment above asm_volatile_goto mentions working around a GCC bug, and
links to a bug report that claims this has been fixed in newer versions of
GCC.  Testing shows that this was resolved in GCC 4.8.2. 
asm_volatile_goto should also be defined for other compilers that support
asm goto.

Link: http://lkml.kernel.org/r/20180907222109.163802-1-ndesaulniers@xxxxxxxxxx
Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>
Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Cc: Paul Burton <paul.burton@xxxxxxxx>
Cc: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Cc: Will Deacon <will.deacon@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/compiler-gcc.h   |    7 ++++++-
 include/linux/compiler_types.h |    4 ++++
 2 files changed, 10 insertions(+), 1 deletion(-)

--- a/include/linux/compiler-gcc.h~include-linux-compilerh-add-version-detection-to-asm_volatile_goto
+++ a/include/linux/compiler-gcc.h
@@ -171,7 +171,7 @@
 #endif
 
 /*
- * GCC 'asm goto' miscompiles certain code sequences:
+ * GCC < 4.8.2 'asm goto' miscompiles certain code sequences:
  *
  *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
  *
@@ -179,7 +179,12 @@
  *
  * (asm goto is automatically volatile - the naming reflects this.)
  */
+#if GCC_VERSION < 40802
 #define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0)
+#else
+#define asm_volatile_goto(x...)	asm goto(x)
+#endif
+
 
 /*
  * sparse (__CHECKER__) pretends to be gcc, but can't do constant
--- a/include/linux/compiler_types.h~include-linux-compilerh-add-version-detection-to-asm_volatile_goto
+++ a/include/linux/compiler_types.h
@@ -151,6 +151,10 @@ struct ftrace_likely_data {
 #define __assume_aligned(a, ...)
 #endif
 
+#ifndef asm_volatile_goto
+#define asm_volatile_goto(x...) asm goto(x)
+#endif
+
 /* Are two types/vars the same type (ignoring qualifiers)? */
 #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
 
_

Patches currently in -mm which might be from ndesaulniers@xxxxxxxxxx are

include-linux-compilerh-add-version-detection-to-asm_volatile_goto.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux