x86/callthunks: Fix and unify call thunks assembly snippets
authorUros Bizjak <ubizjak@gmail.com>
Sun, 5 Nov 2023 21:34:37 +0000 (22:34 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 30 Nov 2023 19:06:17 +0000 (20:06 +0100)
commit2adeed985a42ff3334e6898c8c0827e7626c1336
tree666b5cdb2790388a3aac880a4022a78172612c4d
parent17bce3b2ae2d52e8c5c12274ce4c3a631ce9e66b
x86/callthunks: Fix and unify call thunks assembly snippets

Currently thunk debug macros explicitly define %gs: segment register
prefix for their percpu variables. This is not compatible with
!CONFIG_SMP, which requires non-prefixed percpu variables.

Fix call thunks debug macros to use PER_CPU_VAR macro from percpu.h
to conditionally use %gs: segment register prefix, depending on
CONFIG_SMP.

Finally, unify ASM_ prefixed assembly macros with their non-prefixed
variants. With support of %rip-relative relocations in place, call
thunk templates allow %rip-relative addressing, so unified assembly
snippet can be used everywhere.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20231105213731.1878100-4-ubizjak@gmail.com
arch/x86/include/asm/nospec-branch.h