x86/retpoline: Remove the esp/rsp thunk
PATCH 1/1 x86/retpoline: Remove the esp/rsp thunk
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.
--- arch/x86/include/asm/asm-prototypes.h | 1 - arch/x86/lib/retpoline.S | 1 - 2 files changed, 2 deletions(-)
arch/x86/include/asm/asm-prototypes.h +0 -1
@@ -38,5 +38,4 @@ INDIRECT_THUNK(si) INDIRECT_THUNK(di) INDIRECT_THUNK(bp) -INDIRECT_THUNK(sp)#endif /* CONFIG_RETPOLINE */
arch/x86/lib/retpoline.S +0 -1
@@ -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)
Signature · 1 line
1.8.3.1
Quoted 8 lines · 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 <[email protected]>Signed-off-by Waiman Long <[email protected]>
I spotted that and *almost* removed it a couple of times in other refactoring, but after abandoning those I forgot to come back and do just this. Thanks.
tip-bot for Waiman Long
merge botx86/retpoline: Remove the esp/rsp thunk
Commit-ID: 1df37383a8aeabb9b418698f0bcdffea01f4b1b2 Gitweb: https://git.kernel.org/tip/1df37383a8aeabb9b418698f0bcdffea01f4b1b2 Author: Waiman Long <[email protected]> AuthorDate: Mon, 22 Jan 2018 17:09:34 -0500 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 24 Jan 2018 12:31:55 +0100
x86/retpoline: Remove the esp/rsp thunk
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.
--- arch/x86/include/asm/asm-prototypes.h | 1 - arch/x86/lib/retpoline.S | 1 - 2 files changed, 2 deletions(-)
arch/x86/include/asm/asm-prototypes.h +0 -1
@@ -38,5 +38,4 @@ INDIRECT_THUNK(dx) INDIRECT_THUNK(si) INDIRECT_THUNK(di) INDIRECT_THUNK(bp) -INDIRECT_THUNK(sp)#endif /* CONFIG_RETPOLINE */
arch/x86/lib/retpoline.S +0 -1
@@ -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)