]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/srso: Disentangle rethunk-dependent options
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 Sep 2023 05:05:00 +0000 (22:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:50 +0000 (16:35 +0200)
commit820a3626f3d7ae2656098052f902ea01e2b6aa49
treebfe9a854ce76f305eb4a1a98d4dc77e6573fe947
parent6b10edf9164058ff54a8984206a38961697b98ab
x86/srso: Disentangle rethunk-dependent options

Commit 34a3cae7474c6e6f4a85aad4a7b8191b8b35cdcd upstream.

CONFIG_RETHUNK, CONFIG_CPU_UNRET_ENTRY and CONFIG_CPU_SRSO are all
tangled up.  De-spaghettify the code a bit.

Some of the rethunk-related code has been shuffled around within the
'.text..__x86.return_thunk' section, but otherwise there are no
functional changes.  srso_alias_untrain_ret() and srso_alias_safe_ret()
((which are very address-sensitive) haven't moved.

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/2845084ed303d8384905db3b87b77693945302b4.1693889988.git.jpoimboe@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/vmlinux.lds.S
arch/x86/lib/retpoline.S