]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
init: Mark [arch_call_]rest_init() __noreturn
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 12 Apr 2023 23:49:31 +0000 (16:49 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 14 Apr 2023 15:31:23 +0000 (17:31 +0200)
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
arch/s390/kernel/setup.c
include/linux/start_kernel.h
init/main.c
tools/objtool/check.c

index 8ec5cdf9dadc77d029dc45866f258f80101fc7be..4259b6c505163ce9011ecd6ffeb3d6902a1b6c1e 100644 (file)
@@ -396,7 +396,7 @@ int __init arch_early_irq_init(void)
        return 0;
 }
 
-void __init arch_call_rest_init(void)
+void __init __noreturn arch_call_rest_init(void)
 {
        unsigned long stack;
 
index 8b369a41c03c0afe678d1469fa52d8c6aa0e79e8..864921e54c928fd66dc338e0c90979b9ce6aafa6 100644 (file)
@@ -9,7 +9,7 @@
    up something else. */
 
 extern asmlinkage void __init start_kernel(void);
-extern void __init arch_call_rest_init(void);
-extern void __ref rest_init(void);
+extern void __init __noreturn arch_call_rest_init(void);
+extern void __ref __noreturn rest_init(void);
 
 #endif /* _LINUX_START_KERNEL_H */
index 4425d1783d5c21e8f1da703e503a5edc37a3d93f..161ed956d7383e8dac01bffc4838a1f280ccf8b4 100644 (file)
@@ -683,7 +683,7 @@ static void __init setup_command_line(char *command_line)
 
 static __initdata DECLARE_COMPLETION(kthreadd_done);
 
-noinline void __ref rest_init(void)
+noinline void __ref __noreturn rest_init(void)
 {
        struct task_struct *tsk;
        int pid;
@@ -889,7 +889,7 @@ static int __init early_randomize_kstack_offset(char *buf)
 early_param("randomize_kstack_offset", early_randomize_kstack_offset);
 #endif
 
-void __init __weak arch_call_rest_init(void)
+void __init __weak __noreturn arch_call_rest_init(void)
 {
        rest_init();
 }
index df634dafefc4ed5dbcd70f5ab98e83538db9c694..3d7227f0ea2a3781ed577d78d92ae226062b6597 100644 (file)
@@ -202,6 +202,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "__reiserfs_panic",
                "__stack_chk_fail",
                "__ubsan_handle_builtin_unreachable",
+               "arch_call_rest_init",
                "arch_cpu_idle_dead",
                "cpu_bringup_and_idle",
                "cpu_startup_entry",
@@ -217,6 +218,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "machine_real_restart",
                "make_task_dead",
                "panic",
+               "rest_init",
                "rewind_stack_and_make_dead",
                "sev_es_terminate",
                "snp_abort",