Skip to content

Commit 851a4cd

Browse files
author
Ingo Molnar
committed
Revert "x86/alternatives: Macrofy lock prefixes to work around GCC inlining bugs"
This reverts commit 77f48ec. See this commit for details about the revert: e769742 ("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>
1 parent ffb61c6 commit 851a4cd

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

arch/x86/include/asm/alternative-asm.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,16 @@
77
#include <asm/asm.h>
88

99
#ifdef CONFIG_SMP
10-
.macro LOCK_PREFIX_HERE
10+
.macro LOCK_PREFIX
11+
672: lock
1112
.pushsection .smp_locks,"a"
1213
.balign 4
13-
.long 671f - . # offset
14+
.long 672b - .
1415
.popsection
15-
671:
16-
.endm
17-
18-
.macro LOCK_PREFIX insn:vararg
19-
LOCK_PREFIX_HERE
20-
lock \insn
21-
.endm
16+
.endm
2217
#else
23-
.macro LOCK_PREFIX_HERE
24-
.endm
25-
26-
.macro LOCK_PREFIX insn:vararg
27-
.endm
18+
.macro LOCK_PREFIX
19+
.endm
2820
#endif
2921

3022
/*

arch/x86/include/asm/alternative.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@
3131
*/
3232

3333
#ifdef CONFIG_SMP
34-
#define LOCK_PREFIX_HERE "LOCK_PREFIX_HERE\n\t"
35-
#define LOCK_PREFIX "LOCK_PREFIX "
34+
#define LOCK_PREFIX_HERE \
35+
".pushsection .smp_locks,\"a\"\n" \
36+
".balign 4\n" \
37+
".long 671f - .\n" /* offset */ \
38+
".popsection\n" \
39+
"671:"
40+
41+
#define LOCK_PREFIX LOCK_PREFIX_HERE "\n\tlock; "
42+
3643
#else /* ! CONFIG_SMP */
3744
#define LOCK_PREFIX_HERE ""
3845
#define LOCK_PREFIX ""

arch/x86/kernel/macros.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88

99
#include <linux/compiler.h>
1010
#include <asm/refcount.h>
11-
#include <asm/alternative-asm.h>

0 commit comments

Comments
 (0)