]> git.baikalelectronics.ru Git - kernel.git/commit
x86: Use return-thunk in asm code
authorPeter Zijlstra <peterz@infradead.org>
Tue, 14 Jun 2022 21:15:45 +0000 (23:15 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 27 Jun 2022 08:33:58 +0000 (10:33 +0200)
commitd9111be487f708835e401302d9bcdd3c91f4998a
tree8b8c57aa9dd990a7935a210603570617180171e3
parent5b1ffe0543c7f7f3f5d62988ee3d5a49ac83abd3
x86: Use return-thunk in asm code

Use the return thunk in asm code. If the thunk isn't needed, it will
get patched into a RET instruction during boot by apply_returns().

Since alternatives can't handle relocations outside of the first
instruction, putting a 'jmp __x86_return_thunk' in one is not valid,
therefore carve out the memmove ERMS path into a separate label and jump
to it.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/entry/vdso/Makefile
arch/x86/include/asm/linkage.h
arch/x86/lib/memmove_64.S