linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/retpoline: Fix NOSPEC_JMP for tip
@ 2018-01-10  0:31 Andi Kleen
  2018-01-10  0:39 ` Thomas Gleixner
  2018-01-10  0:39 ` Linus Torvalds
  0 siblings, 2 replies; 44+ messages in thread
From: Andi Kleen @ 2018-01-10  0:31 UTC (permalink / raw)
  To: tglx
  Cc: x86, linux-kernel, torvalds, dwmw, pjt, luto, peterz,
	thomas.lendacky, tim.c.chen, gregkh, dave.hansen, jikos,
	Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

With the latest tip x86/pti I get oopses when booting
a 64bit VM in qemu with RETPOLINE/gcc7 and PTI enabled.

The following patch fixes it for me. Something doesn't
seem to work with ALTERNATIVE_2. It adds only a few bytes
more code, so seems acceptable.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/nospec-branch.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 8ddf8513550e..eea6340a0abb 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -46,9 +46,8 @@
  */
 .macro JMP_NOSPEC reg:req
 #ifdef CONFIG_RETPOLINE
-	ALTERNATIVE_2 __stringify(jmp *\reg),				\
-		__stringify(RETPOLINE_JMP \reg), X86_FEATURE_RETPOLINE,	\
-		__stringify(lfence; jmp *\reg), X86_FEATURE_RETPOLINE_AMD
+	ALTERNATIVE "", __stringify(lfence; jmp *\reg), X86_FEATURE_RETPOLINE_AMD
+	ALTERNATIVE __stringify(jmp *\reg), __stringify(RETPOLINE_JMP \reg), X86_FEATURE_RETPOLINE
 #else
 	jmp	*\reg
 #endif
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2018-01-10 21:44 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10  0:31 [PATCH] x86/retpoline: Fix NOSPEC_JMP for tip Andi Kleen
2018-01-10  0:39 ` Thomas Gleixner
2018-01-10  0:39 ` Linus Torvalds
2018-01-10  0:40   ` Thomas Gleixner
2018-01-10  0:45     ` Tom Lendacky
2018-01-10  0:50       ` Thomas Gleixner
2018-01-10  1:30       ` Andi Kleen
2018-01-10  1:36         ` Andi Kleen
2018-01-10  1:50           ` Thomas Gleixner
2018-01-10  1:57             ` Andi Kleen
2018-01-10  9:05         ` David Woodhouse
2018-01-10  0:51   ` Andi Kleen
2018-01-10  1:05     ` Thomas Gleixner
2018-01-10  7:15   ` David Woodhouse
2018-01-10 10:05     ` David Woodhouse
2018-01-10 11:28       ` [PATCH] x86/alternatives: Fix optimize_nops() checking Borislav Petkov
2018-01-10 11:36         ` David Woodhouse
2018-01-10 11:45           ` Borislav Petkov
2018-01-10 11:49             ` David Woodhouse
2018-01-10 11:57               ` Borislav Petkov
2018-01-10 11:58                 ` David Woodhouse
2018-01-10 17:33         ` [tip:x86/pti] " tip-bot for Borislav Petkov
2018-01-10 18:12         ` tip-bot for Borislav Petkov
2018-01-10 18:39         ` tip-bot for Borislav Petkov
2018-01-10 19:38         ` [PATCH] " Linus Torvalds
2018-01-10 19:55           ` Thomas Gleixner
2018-01-10 20:15             ` Josh Poimboeuf
2018-01-10 20:19               ` David Woodhouse
2018-01-10 20:26               ` Linus Torvalds
2018-01-10 20:33                 ` Peter Zijlstra
2018-01-10 20:36                   ` David Woodhouse
2018-01-10 20:49                   ` Linus Torvalds
2018-01-10 20:55                 ` Borislav Petkov
2018-01-10 21:05                   ` Linus Torvalds
2018-01-10 21:08                     ` David Woodhouse
2018-01-10 21:11                       ` Linus Torvalds
2018-01-10 21:16                         ` Josh Poimboeuf
2018-01-10 21:17                         ` Linus Torvalds
2018-01-10 21:27                           ` Josh Poimboeuf
2018-01-10 21:10                     ` Borislav Petkov
2018-01-10 20:55                 ` Josh Poimboeuf
2018-01-10 20:05           ` Borislav Petkov
2018-01-10 20:20             ` Linus Torvalds
2018-01-10 20:50               ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).