Skip to contentSkip to conversation

s390/ipl: Mark store_status as __noreturn

PATCH In review Thorsten Blum 2 participants 7 messages Nov 10, 2025 – Nov 11, 2025 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 s390/ipl: Mark store_status as __noreturn

store_status() performs a tail call (BR_EX) to the function passed as the first parameter and does not return. Annotate the declaration with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/include/asm/ipl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/ipl.h +1 -1
index b0d00032479d..637b29bf8a6d 100644
@@ -164,7 +164,7 @@ enum diag308_rc {
 };
 
 extern int diag308(unsigned long subcode, void *addr);
-extern void store_status(void (*fn)(void *), void *data);
+extern void __noreturn store_status(void (*fn)(void *), void *data);
 extern void lgr_info_log(void);
 
 #endif /* _ASM_S390_IPL_H */
Signature · 1 line
2.51.1
#1 lore raw

PATCH 2/5 s390/kdump: Mark __machine_kdump as __noreturn

__machine_kdump() ends by calling the non-returning function store_status() and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index baeb3dcfc1c8..b6b0a85816f3 100644
@@ -77,7 +77,7 @@ static void __do_machine_kdump(void *data)
  * Start kdump: create a LGR log entry, store status of all CPUs and
  * branch to __do_machine_kdump.
  */
-static noinline void __machine_kdump(void *image)
+static noinline void __noreturn __machine_kdump(void *image)
 {
 	struct mcesa *mcesa;
 	union ctlreg2 cr2_old, cr2_new;
Signature · 1 line
2.51.1
#2 lore raw

PATCH 3/5 s390/kdump: Mark __do_machine_kexec as __noreturn

In reply to Thorsten Blum

__do_machine_kexec() ends by calling the non-returning function disabled_wait() and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index b6b0a85816f3..6de5e0fde49a 100644
@@ -224,7 +224,7 @@ void machine_crash_shutdown(struct pt_regs *regs)
 /*
  * Do normal kexec
  */
-static void __do_machine_kexec(void *data)
+static void __noreturn __do_machine_kexec(void *data)
 {
 	unsigned long data_mover, entry, diag308_subcode;
 	struct kimage *image = data;
Signature · 1 line
2.51.1
#3 lore raw

PATCH 4/5 s390/kdump: Mark __machine_kexec as __noreturn

In reply to Thorsten Blum

__machine_kexec() either ends by calling the non-returning function __machine_kdump() or the non-returning function __do_machine_kexec(), and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index 6de5e0fde49a..d78e6e3d962f 100644
@@ -248,7 +248,7 @@ static void __noreturn __do_machine_kexec(void *data)
 /*
  * Reset system and call either kdump or normal kexec
  */
-static void __machine_kexec(void *data)
+static void __noreturn __machine_kexec(void *data)
 {
 	pfault_fini();
 	tracing_off();
Signature · 1 line
2.51.1
#4 lore raw

PATCH 5/5 s390/kdump: Mark __do_machine_kdump as __noreturn

In reply to Thorsten Blum

__do_machine_kdump() ends by calling the non-returning function disabled_wait() and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index d78e6e3d962f..ca51168500fe 100644
@@ -45,7 +45,7 @@ extern const unsigned long long relocate_kernel_len;
  * Reset the system, copy boot CPU registers to absolute zero,
  * and jump to the kdump image
  */
-static void __do_machine_kdump(void *data)
+static void __noreturn __do_machine_kdump(void *data)
 {
 	struct kimage *image = data;
 	purgatory_t purgatory;
Signature · 1 line
2.51.1
maintainer
#5 lore raw
In reply to Thorsten Blum
Quoted 8 lines · Thorsten Blum

store_status() performs a tail call (BR_EX) to the function passed as the first parameter and does not return. Annotate the declaration with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/include/asm/ipl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This doesn't make any sense. If a function is called, which calls another one with a tail call, then _of course_ it looks to the caller like the function returned.

#6 lore raw
Quoted 5 lines · Heiko Carstens
Quoted 4 lines · Thorsten Blum

store_status() performs a tail call (BR_EX) to the function passed as the first parameter and does not return. Annotate the declaration with the __noreturn attribute to improve compiler optimizations.

Quoted 8 lines
Quoted 4 lines

---
arch/s390/include/asm/ipl.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

This doesn't make any sense. If a function is called, which calls another one with a tail call, then _of course_ it looks to the caller like the function returned.

Hm, I must have misunderstood this comment from
arch/s390/kernel/machine_kexec.c:

/*
* ...
* The call to store_status() will not return.
*/
store_status(__do_machine_kdump, image);