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

init: Mark [arch_call_]rest_init() __noreturn

In preparation for improving objtool's handling of weak noreturn
functions, mark start_kernel(), arch_call_rest_init(), and rest_init()
__noreturn.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/7194ed8a989a85b98d92e62df660f4a90435a723.1681342859.git.jpoimboe@kernel.org

authored by

Josh Poimboeuf and committed by
Peter Zijlstra
9ea7e6b6 5743654f

+7 -5
+1 -1
arch/s390/kernel/setup.c
··· 396 396 return 0; 397 397 } 398 398 399 - void __init arch_call_rest_init(void) 399 + void __init __noreturn arch_call_rest_init(void) 400 400 { 401 401 unsigned long stack; 402 402
+2 -2
include/linux/start_kernel.h
··· 9 9 up something else. */ 10 10 11 11 extern asmlinkage void __init start_kernel(void); 12 - extern void __init arch_call_rest_init(void); 13 - extern void __ref rest_init(void); 12 + extern void __init __noreturn arch_call_rest_init(void); 13 + extern void __ref __noreturn rest_init(void); 14 14 15 15 #endif /* _LINUX_START_KERNEL_H */
+2 -2
init/main.c
··· 683 683 684 684 static __initdata DECLARE_COMPLETION(kthreadd_done); 685 685 686 - noinline void __ref rest_init(void) 686 + noinline void __ref __noreturn rest_init(void) 687 687 { 688 688 struct task_struct *tsk; 689 689 int pid; ··· 889 889 early_param("randomize_kstack_offset", early_randomize_kstack_offset); 890 890 #endif 891 891 892 - void __init __weak arch_call_rest_init(void) 892 + void __init __weak __noreturn arch_call_rest_init(void) 893 893 { 894 894 rest_init(); 895 895 }
+2
tools/objtool/check.c
··· 202 202 "__reiserfs_panic", 203 203 "__stack_chk_fail", 204 204 "__ubsan_handle_builtin_unreachable", 205 + "arch_call_rest_init", 205 206 "arch_cpu_idle_dead", 206 207 "cpu_bringup_and_idle", 207 208 "cpu_startup_entry", ··· 218 217 "machine_real_restart", 219 218 "make_task_dead", 220 219 "panic", 220 + "rest_init", 221 221 "rewind_stack_and_make_dead", 222 222 "sev_es_terminate", 223 223 "snp_abort",