Revert "x86/alternatives: Macrofy lock prefixes to work around GCC inlining bugs"
authorIngo Molnar <mingo@kernel.org>
Wed, 19 Dec 2018 10:20:57 +0000 (11:20 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Dec 2018 11:00:04 +0000 (12:00 +0100)
This reverts commit 77f48ec28e4ccff94d2e5f4260a83ac27a7f3099.

See this commit for details about the revert:

  e769742d3584 ("Revert "x86/jump-labels: Macrofy inline assembly code to work around GCC inlining bugs"")

Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Borislav Petkov <bp@alien8.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Juergen Gross <jgross@suse.com>
Cc: Richard Biener <rguenther@suse.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/alternative-asm.h
arch/x86/include/asm/alternative.h
arch/x86/kernel/macros.S

index 8e4ea39e55d071de447bb1c1336dce2ec314ad5e..31b627b43a8e01933d6209e746f4c08912d0cdef 100644 (file)
@@ -7,24 +7,16 @@
 #include <asm/asm.h>
 
 #ifdef CONFIG_SMP
-.macro LOCK_PREFIX_HERE
+       .macro LOCK_PREFIX
+672:   lock
        .pushsection .smp_locks,"a"
        .balign 4
-       .long 671f - .          # offset
+       .long 672b - .
        .popsection
-671:
-.endm
-
-.macro LOCK_PREFIX insn:vararg
-       LOCK_PREFIX_HERE
-       lock \insn
-.endm
+       .endm
 #else
-.macro LOCK_PREFIX_HERE
-.endm
-
-.macro LOCK_PREFIX insn:vararg
-.endm
+       .macro LOCK_PREFIX
+       .endm
 #endif
 
 /*
index d7faa16622d81d39ff11d703fad17ed7931cce86..4cd6a3b71824293ae3edb664bc5ed6e48ca5a459 100644 (file)
  */
 
 #ifdef CONFIG_SMP
-#define LOCK_PREFIX_HERE "LOCK_PREFIX_HERE\n\t"
-#define LOCK_PREFIX "LOCK_PREFIX "
+#define LOCK_PREFIX_HERE \
+               ".pushsection .smp_locks,\"a\"\n"       \
+               ".balign 4\n"                           \
+               ".long 671f - .\n" /* offset */         \
+               ".popsection\n"                         \
+               "671:"
+
+#define LOCK_PREFIX LOCK_PREFIX_HERE "\n\tlock; "
+
 #else /* ! CONFIG_SMP */
 #define LOCK_PREFIX_HERE ""
 #define LOCK_PREFIX ""
index 852487a9fc5689c43fad486ed9b008e5fe41a887..f1fe1d570365ad6871f0cdeecb97cefad7fc584c 100644 (file)
@@ -8,4 +8,3 @@
 
 #include <linux/compiler.h>
 #include <asm/refcount.h>
-#include <asm/alternative-asm.h>