Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/entry: Move thunk restore code into thunk functions

There's no need for both thunk functions to jump to the same shared
thunk restore code which lives outside the thunk function boundaries.
It disrupts i-cache locality and confuses objtool. Keep it simple by
keeping each thunk's restore code self-contained within the function.

Fixes a bunch of false positive "missing __noreturn" warnings like:

vmlinux.o: warning: objtool: do_arch_prctl_common+0xf4: preempt_schedule_thunk() is missing a __noreturn annotation

Fixes: fedb724c3db5 ("objtool: Detect missing __noreturn annotations")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305281037.3PaI3tW4-lkp@intel.com/
Link: https://lore.kernel.org/r/46aa8aeb716f302e22e1673ae15ee6fe050b41f4.1685488050.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

+8 -12
+8 -12
arch/x86/entry/thunk_64.S
··· 26 26 pushq %r11 27 27 28 28 call \func 29 - jmp __thunk_restore 30 - SYM_FUNC_END(\name) 31 - _ASM_NOKPROBE(\name) 32 - .endm 33 29 34 - THUNK preempt_schedule_thunk, preempt_schedule 35 - THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace 36 - EXPORT_SYMBOL(preempt_schedule_thunk) 37 - EXPORT_SYMBOL(preempt_schedule_notrace_thunk) 38 - 39 - SYM_CODE_START_LOCAL(__thunk_restore) 40 30 popq %r11 41 31 popq %r10 42 32 popq %r9 ··· 38 48 popq %rdi 39 49 popq %rbp 40 50 RET 41 - _ASM_NOKPROBE(__thunk_restore) 42 - SYM_CODE_END(__thunk_restore) 51 + SYM_FUNC_END(\name) 52 + _ASM_NOKPROBE(\name) 53 + .endm 54 + 55 + THUNK preempt_schedule_thunk, preempt_schedule 56 + THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace 57 + EXPORT_SYMBOL(preempt_schedule_thunk) 58 + EXPORT_SYMBOL(preempt_schedule_notrace_thunk)