mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/retpoline: Remove the esp/rsp thunk
@ 2018-01-22 22:09 Waiman Long
  2018-01-22 22:21 ` David Woodhouse
  2018-01-24 11:42 ` [tip:x86/pti] " tip-bot for Waiman Long
  0 siblings, 2 replies; 3+ messages in thread
From: Waiman Long @ 2018-01-22 22:09 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Peter Zijlstra
  Cc: linux-kernel, David Woodhouse, Arjan van de Ven, Andi Kleen,
	Josh Poimboeuf, Jeff Law, Linus Torvalds, Jiri Kosina,
	Andy Lutomirski, Dave Hansen, Kees Cook, Tim Chen,
	Greg Kroah-Hartman, Paul Turner, Tom Lendacky, Waiman Long

It doesn't make sense to have an indirect call thunk with esp/rsp as
retpoline code won't work correctly with the stack pointer register.
Removing it will help compiler writers to catch error in case such
a thunk call is emitted incorrectly.

Fixes: 76b043848fd2 ("x86/retpoline: Add initial retpoline support")
Suggested-by: Jeff Law <law@redhat.com>
Signed-off-by: Waiman Long <longman@redhat.com>
---
 arch/x86/include/asm/asm-prototypes.h | 1 -
 arch/x86/lib/retpoline.S              | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
index 0927cdc..1908214 100644
--- a/arch/x86/include/asm/asm-prototypes.h
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -38,5 +38,4 @@
 INDIRECT_THUNK(si)
 INDIRECT_THUNK(di)
 INDIRECT_THUNK(bp)
-INDIRECT_THUNK(sp)
 #endif /* CONFIG_RETPOLINE */
diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index dfb2ba9..c909961 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -36,7 +36,6 @@ GENERATE_THUNK(_ASM_DX)
 GENERATE_THUNK(_ASM_SI)
 GENERATE_THUNK(_ASM_DI)
 GENERATE_THUNK(_ASM_BP)
-GENERATE_THUNK(_ASM_SP)
 #ifdef CONFIG_64BIT
 GENERATE_THUNK(r8)
 GENERATE_THUNK(r9)
-- 
1.8.3.1

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

end of thread, other threads:[~2018-01-24 11:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-22 22:09 [PATCH] x86/retpoline: Remove the esp/rsp thunk Waiman Long
2018-01-22 22:21 ` David Woodhouse
2018-01-24 11:42 ` [tip:x86/pti] " tip-bot for Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®