linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] s390/ipl: Mark store_status as __noreturn
@ 2025-11-10 13:27 Thorsten Blum
  2025-11-10 13:27 ` [PATCH 2/5] s390/kdump: Mark __machine_kdump " Thorsten Blum
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-11-10 13:27 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: Thorsten Blum, linux-s390, linux-kernel

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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/s390/include/asm/ipl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/include/asm/ipl.h b/arch/s390/include/asm/ipl.h
index b0d00032479d..637b29bf8a6d 100644
--- a/arch/s390/include/asm/ipl.h
+++ b/arch/s390/include/asm/ipl.h
@@ -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 */
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] s390/kdump: Mark __machine_kdump as __noreturn
  2025-11-10 13:27 [PATCH 1/5] s390/ipl: Mark store_status as __noreturn Thorsten Blum
@ 2025-11-10 13:27 ` Thorsten Blum
  2025-11-10 13:27 ` [PATCH 3/5] s390/kdump: Mark __do_machine_kexec " Thorsten Blum
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-11-10 13:27 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: Thorsten Blum, linux-s390, linux-kernel

__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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index baeb3dcfc1c8..b6b0a85816f3 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -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;
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] s390/kdump: Mark __do_machine_kexec as __noreturn
  2025-11-10 13:27 [PATCH 1/5] s390/ipl: Mark store_status as __noreturn Thorsten Blum
  2025-11-10 13:27 ` [PATCH 2/5] s390/kdump: Mark __machine_kdump " Thorsten Blum
@ 2025-11-10 13:27 ` Thorsten Blum
  2025-11-10 13:27 ` [PATCH 4/5] s390/kdump: Mark __machine_kexec " Thorsten Blum
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-11-10 13:27 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: Thorsten Blum, linux-s390, linux-kernel

__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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index b6b0a85816f3..6de5e0fde49a 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -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;
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] s390/kdump: Mark __machine_kexec as __noreturn
  2025-11-10 13:27 [PATCH 1/5] s390/ipl: Mark store_status as __noreturn Thorsten Blum
  2025-11-10 13:27 ` [PATCH 2/5] s390/kdump: Mark __machine_kdump " Thorsten Blum
  2025-11-10 13:27 ` [PATCH 3/5] s390/kdump: Mark __do_machine_kexec " Thorsten Blum
@ 2025-11-10 13:27 ` Thorsten Blum
  2025-11-10 13:27 ` [PATCH 5/5] s390/kdump: Mark __do_machine_kdump " Thorsten Blum
  2025-11-10 15:06 ` [PATCH 1/5] s390/ipl: Mark store_status " Heiko Carstens
  4 siblings, 0 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-11-10 13:27 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: Thorsten Blum, linux-s390, linux-kernel

__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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 6de5e0fde49a..d78e6e3d962f 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -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();
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] s390/kdump: Mark __do_machine_kdump as __noreturn
  2025-11-10 13:27 [PATCH 1/5] s390/ipl: Mark store_status as __noreturn Thorsten Blum
                   ` (2 preceding siblings ...)
  2025-11-10 13:27 ` [PATCH 4/5] s390/kdump: Mark __machine_kexec " Thorsten Blum
@ 2025-11-10 13:27 ` Thorsten Blum
  2025-11-10 15:06 ` [PATCH 1/5] s390/ipl: Mark store_status " Heiko Carstens
  4 siblings, 0 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-11-10 13:27 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: Thorsten Blum, linux-s390, linux-kernel

__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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index d78e6e3d962f..ca51168500fe 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -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;
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/5] s390/ipl: Mark store_status as __noreturn
  2025-11-10 13:27 [PATCH 1/5] s390/ipl: Mark store_status as __noreturn Thorsten Blum
                   ` (3 preceding siblings ...)
  2025-11-10 13:27 ` [PATCH 5/5] s390/kdump: Mark __do_machine_kdump " Thorsten Blum
@ 2025-11-10 15:06 ` Heiko Carstens
  2025-11-11  7:00   ` Thorsten Blum
  4 siblings, 1 reply; 7+ messages in thread
From: Heiko Carstens @ 2025-11-10 15:06 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, linux-s390, linux-kernel

On Mon, Nov 10, 2025 at 02:27:51PM +0100, Thorsten Blum wrote:
> 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.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/5] s390/ipl: Mark store_status as __noreturn
  2025-11-10 15:06 ` [PATCH 1/5] s390/ipl: Mark store_status " Heiko Carstens
@ 2025-11-11  7:00   ` Thorsten Blum
  0 siblings, 0 replies; 7+ messages in thread
From: Thorsten Blum @ 2025-11-11  7:00 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, linux-s390, linux-kernel

On 10. Nov 2025, at 16:06, Heiko Carstens wrote:
> On Mon, Nov 10, 2025 at 02:27:51PM +0100, Thorsten Blum wrote:
>> 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.
>> 
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>> ---
>> 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);


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-11  7:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 13:27 [PATCH 1/5] s390/ipl: Mark store_status as __noreturn Thorsten Blum
2025-11-10 13:27 ` [PATCH 2/5] s390/kdump: Mark __machine_kdump " Thorsten Blum
2025-11-10 13:27 ` [PATCH 3/5] s390/kdump: Mark __do_machine_kexec " Thorsten Blum
2025-11-10 13:27 ` [PATCH 4/5] s390/kdump: Mark __machine_kexec " Thorsten Blum
2025-11-10 13:27 ` [PATCH 5/5] s390/kdump: Mark __do_machine_kdump " Thorsten Blum
2025-11-10 15:06 ` [PATCH 1/5] s390/ipl: Mark store_status " Heiko Carstens
2025-11-11  7:00   ` Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).