From: Josh Poimboeuf <jpoimboe@kernel.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Miroslav Benes <mbenes@suse.cz>,
linux-btrfs@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
linux-scsi@vger.kernel.org, linux-hyperv@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>,
"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
Michael Kelley <mikelley@microsoft.com>
Subject: [PATCH 01/11] init: Mark [arch_call_]rest_init() __noreturn
Date: Fri, 7 Apr 2023 17:09:54 -0700 [thread overview]
Message-ID: <b24a972397061a67d46ff5a98657e352040f427a.1680912057.git.jpoimboe@kernel.org> (raw)
In-Reply-To: <cover.1680912057.git.jpoimboe@kernel.org>
Fixes the following warning:
init/main.o: warning: objtool: start_kernel+0x4ad: unreachable instruction
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
arch/s390/kernel/setup.c | 2 +-
include/linux/start_kernel.h | 4 ++--
init/main.c | 4 ++--
tools/objtool/check.c | 2 ++
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 8ec5cdf9dadc..4259b6c50516 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -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;
diff --git a/include/linux/start_kernel.h b/include/linux/start_kernel.h
index 8b369a41c03c..864921e54c92 100644
--- a/include/linux/start_kernel.h
+++ b/include/linux/start_kernel.h
@@ -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 */
diff --git a/init/main.c b/init/main.c
index 4425d1783d5c..161ed956d738 100644
--- a/init/main.c
+++ b/init/main.c
@@ -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();
}
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index cae6ac6ff246..e7442e7ad676 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -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",
--
2.39.2
next prev parent reply other threads:[~2023-04-08 0:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-08 0:09 [PATCH 00/12] Sprinkle more __noreturn Josh Poimboeuf
2023-04-08 0:09 ` Josh Poimboeuf [this message]
2023-04-10 20:02 ` [PATCH 01/11] init: Mark [arch_call_]rest_init() __noreturn Nick Desaulniers
2023-04-08 0:09 ` [PATCH 02/11] init: Mark start_kernel() __noreturn Josh Poimboeuf
2023-04-12 20:29 ` Nick Desaulniers
2023-04-12 21:57 ` Josh Poimboeuf
2023-04-12 23:26 ` Josh Poimboeuf
2023-04-08 0:09 ` [PATCH 03/11] x86/head: Mark *_start_kernel() __noreturn Josh Poimboeuf
2023-04-08 0:09 ` [PATCH 04/11] btrfs: Mark btrfs_assertfail() __noreturn Josh Poimboeuf
2023-04-08 0:09 ` [PATCH 05/11] arm64/cpu: Mark cpu_park_loop() and friends __noreturn Josh Poimboeuf
2023-04-08 0:09 ` [PATCH 06/11] cpu: Mark panic_smp_self_stop() __noreturn Josh Poimboeuf
2023-04-08 0:10 ` [PATCH 07/11] cpu: Mark nmi_panic_self_stop() __noreturn Josh Poimboeuf
2023-04-08 0:10 ` [PATCH 08/11] x86/cpu: Mark {hlt,resume}_play_dead() __noreturn Josh Poimboeuf
2023-04-08 0:10 ` [PATCH 09/11] objtool: Include weak functions in global_noreturns check Josh Poimboeuf
2023-04-08 0:10 ` [PATCH 10/11] scsi: message: fusion: Mark mpt_halt_firmware() __noreturn Josh Poimboeuf
2023-04-08 0:10 ` [PATCH 11/11] x86/hyperv: Mark hv_ghcb_terminate() as noreturn Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b24a972397061a67d46ff5a98657e352040f427a.1680912057.git.jpoimboe@kernel.org \
--to=jpoimboe@kernel.org \
--cc=arnd@arndb.de \
--cc=gpiccoli@igalia.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mbenes@suse.cz \
--cc=mikelley@microsoft.com \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®