summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-09-05 08:04:55 +0300
committerBorislav Petkov (AMD) <bp@alien8.de>2023-10-20 13:04:18 +0300
commitaa730cff0c26244e88066b5b461a9f5fbac13823 (patch)
tree6fdbd4433a44474f020aa7d8235202cc5720942a /arch
parenteeb9f34df065f42f0c9195b322ba6df420c9fc92 (diff)
downloadlinux-aa730cff0c26244e88066b5b461a9f5fbac13823.tar.xz
x86/srso: Improve i-cache locality for alias mitigation
Move srso_alias_return_thunk() to the same section as srso_alias_safe_ret() so they can share a cache line. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/eadaf5530b46a7ae8b936522da45ae555d2b3393.1693889988.git.jpoimboe@kernel.org
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/retpoline.S5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index cd86aeb5fdd3..9ab634f0b5d2 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -177,15 +177,14 @@ SYM_START(srso_alias_safe_ret, SYM_L_GLOBAL, SYM_A_NONE)
int3
SYM_FUNC_END(srso_alias_safe_ret)
- .section .text..__x86.return_thunk
-
-SYM_CODE_START(srso_alias_return_thunk)
+SYM_CODE_START_NOALIGN(srso_alias_return_thunk)
UNWIND_HINT_FUNC
ANNOTATE_NOENDBR
call srso_alias_safe_ret
ud2
SYM_CODE_END(srso_alias_return_thunk)
+ .section .text..__x86.return_thunk
/*
* Some generic notes on the untraining sequences:
*