linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix up build issues with vpanic
@ 2025-07-11 11:20 Nam Cao
  2025-07-11 11:20 ` [PATCH 1/2] objtool: Add vpanic() to the noreturn list Nam Cao
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Nam Cao @ 2025-07-11 11:20 UTC (permalink / raw)
  To: Steven Rostedt, John Ogness, Masami Hiramatsu, Mathieu Desnoyers,
	Gabriele Monaco, linux-trace-kernel, Josh Poimboeuf,
	Peter Zijlstra, Petr Mladek, linux-kernel
  Cc: Nam Cao

Hi,

The newly introduced vpanic() has some build issues. This series fix them
up.

As the vpanic() is only in ftrace tree for now, it is probably best to let
this series goes to ftrace tree, if everyone is okay with that.

Best regards,
Nam

Nam Cao (2):
  objtool: Add vpanic() to the noreturn list
  panic: Fix up description of vpanic()

 kernel/panic.c            | 2 +-
 tools/objtool/noreturns.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.39.5


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

* [PATCH 1/2] objtool: Add vpanic() to the noreturn list
  2025-07-11 11:20 [PATCH 0/2] Fix up build issues with vpanic Nam Cao
@ 2025-07-11 11:20 ` Nam Cao
  2025-07-11 11:20 ` [PATCH 2/2] panic: Fix up description of vpanic() Nam Cao
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Nam Cao @ 2025-07-11 11:20 UTC (permalink / raw)
  To: Steven Rostedt, John Ogness, Masami Hiramatsu, Mathieu Desnoyers,
	Gabriele Monaco, linux-trace-kernel, Josh Poimboeuf,
	Peter Zijlstra, Petr Mladek, linux-kernel
  Cc: Nam Cao, kernel test robot

vpanic() does not return. However, objtool doesn't know this and gets
confused:
kernel/trace/rv/reactor_panic.o: warning: objtool: rv_panic_reaction(): unexpected end of section .text

Add vpanic() to the list of noreturn functions.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507110826.2ekbVdWZ-lkp@intel.com/
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
 tools/objtool/noreturns.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/objtool/noreturns.h b/tools/objtool/noreturns.h
index eacfe3b0a8d1..6a922d046b8e 100644
--- a/tools/objtool/noreturns.h
+++ b/tools/objtool/noreturns.h
@@ -38,6 +38,7 @@ NORETURN(mpt_halt_firmware)
 NORETURN(mwait_play_dead)
 NORETURN(nmi_panic_self_stop)
 NORETURN(panic)
+NORETURN(vpanic)
 NORETURN(panic_smp_self_stop)
 NORETURN(rest_init)
 NORETURN(rewind_stack_and_make_dead)
-- 
2.39.5


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

* [PATCH 2/2] panic: Fix up description of vpanic()
  2025-07-11 11:20 [PATCH 0/2] Fix up build issues with vpanic Nam Cao
  2025-07-11 11:20 ` [PATCH 1/2] objtool: Add vpanic() to the noreturn list Nam Cao
@ 2025-07-11 11:20 ` Nam Cao
  2025-07-15  5:56   ` Masami Hiramatsu
  2025-07-11 11:28 ` [PATCH 0/2] Fix up build issues with vpanic Peter Zijlstra
  2025-07-11 16:24 ` Steven Rostedt
  3 siblings, 1 reply; 9+ messages in thread
From: Nam Cao @ 2025-07-11 11:20 UTC (permalink / raw)
  To: Steven Rostedt, John Ogness, Masami Hiramatsu, Mathieu Desnoyers,
	Gabriele Monaco, linux-trace-kernel, Josh Poimboeuf,
	Peter Zijlstra, Petr Mladek, linux-kernel
  Cc: Nam Cao, Stephen Rothwell

The description above vpanic() has the wrong function name. Fix it up.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/lkml/20250711183802.2d8c124d@canb.auug.org.au/
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
 kernel/panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 6a1823c383d0..2a499facde13 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -307,7 +307,7 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
 }
 
 /**
- * panic - halt the system
+ * vpanic - halt the system
  * @fmt: The text string to print
  * @args: Arguments for the format string
  *
-- 
2.39.5


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

* Re: [PATCH 0/2] Fix up build issues with vpanic
  2025-07-11 11:20 [PATCH 0/2] Fix up build issues with vpanic Nam Cao
  2025-07-11 11:20 ` [PATCH 1/2] objtool: Add vpanic() to the noreturn list Nam Cao
  2025-07-11 11:20 ` [PATCH 2/2] panic: Fix up description of vpanic() Nam Cao
@ 2025-07-11 11:28 ` Peter Zijlstra
  2025-07-11 12:06   ` Nam Cao
  2025-07-11 16:24 ` Steven Rostedt
  3 siblings, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2025-07-11 11:28 UTC (permalink / raw)
  To: Nam Cao
  Cc: Steven Rostedt, John Ogness, Masami Hiramatsu, Mathieu Desnoyers,
	Gabriele Monaco, linux-trace-kernel, Josh Poimboeuf, Petr Mladek,
	linux-kernel

On Fri, Jul 11, 2025 at 01:20:41PM +0200, Nam Cao wrote:
> Hi,
> 
> The newly introduced vpanic() has some build issues. This series fix them
> up.
> 
> As the vpanic() is only in ftrace tree for now, it is probably best to let
> this series goes to ftrace tree, if everyone is okay with that.

Does it make sense to make panic a static inline?

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

* Re: [PATCH 0/2] Fix up build issues with vpanic
  2025-07-11 11:28 ` [PATCH 0/2] Fix up build issues with vpanic Peter Zijlstra
@ 2025-07-11 12:06   ` Nam Cao
  0 siblings, 0 replies; 9+ messages in thread
From: Nam Cao @ 2025-07-11 12:06 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Steven Rostedt, John Ogness, Masami Hiramatsu, Mathieu Desnoyers,
	Gabriele Monaco, linux-trace-kernel, Josh Poimboeuf, Petr Mladek,
	linux-kernel

On Fri, Jul 11, 2025 at 01:28:44PM +0200, Peter Zijlstra wrote:
> On Fri, Jul 11, 2025 at 01:20:41PM +0200, Nam Cao wrote:
> > Hi,
> > 
> > The newly introduced vpanic() has some build issues. This series fix them
> > up.
> > 
> > As the vpanic() is only in ftrace tree for now, it is probably best to let
> > this series goes to ftrace tree, if everyone is okay with that.
> 
> Does it make sense to make panic a static inline?

I think no, code size increases by a few K:

text      data     bss     dec       hex      filename
12222627  6097658  479669  18799954  11edd52  vmlinux.before
12226703  6098618  479669  18804990  11ef0fe  vmlinux.after

(it's riscv64, I had issue converting on x86 because there's another
definition of panic())

Maybe faster? But panic() doesn't need to be fast, it's not called in
normal circumstances anyway.

Best regards,
Nam

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

* Re: [PATCH 0/2] Fix up build issues with vpanic
  2025-07-11 11:20 [PATCH 0/2] Fix up build issues with vpanic Nam Cao
                   ` (2 preceding siblings ...)
  2025-07-11 11:28 ` [PATCH 0/2] Fix up build issues with vpanic Peter Zijlstra
@ 2025-07-11 16:24 ` Steven Rostedt
  2025-07-11 18:18   ` Peter Zijlstra
  3 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2025-07-11 16:24 UTC (permalink / raw)
  To: Nam Cao
  Cc: John Ogness, Masami Hiramatsu, Mathieu Desnoyers, Gabriele Monaco,
	linux-trace-kernel, Josh Poimboeuf, Peter Zijlstra, Petr Mladek,
	linux-kernel

On Fri, 11 Jul 2025 13:20:41 +0200
Nam Cao <namcao@linutronix.de> wrote:

> Hi,
> 
> The newly introduced vpanic() has some build issues. This series fix them
> up.
> 
> As the vpanic() is only in ftrace tree for now, it is probably best to let
> this series goes to ftrace tree, if everyone is okay with that.

Since the bug is in my tree I'll take it, but can I get an acked-by
from Peter or Josh?

Thanks,

-- Steve

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

* Re: [PATCH 0/2] Fix up build issues with vpanic
  2025-07-11 16:24 ` Steven Rostedt
@ 2025-07-11 18:18   ` Peter Zijlstra
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Zijlstra @ 2025-07-11 18:18 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Nam Cao, John Ogness, Masami Hiramatsu, Mathieu Desnoyers,
	Gabriele Monaco, linux-trace-kernel, Josh Poimboeuf, Petr Mladek,
	linux-kernel

On Fri, Jul 11, 2025 at 12:24:13PM -0400, Steven Rostedt wrote:
> On Fri, 11 Jul 2025 13:20:41 +0200
> Nam Cao <namcao@linutronix.de> wrote:
> 
> > Hi,
> > 
> > The newly introduced vpanic() has some build issues. This series fix them
> > up.
> > 
> > As the vpanic() is only in ftrace tree for now, it is probably best to let
> > this series goes to ftrace tree, if everyone is okay with that.
> 
> Since the bug is in my tree I'll take it, but can I get an acked-by
> from Peter or Josh?

Sure

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

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

* Re: [PATCH 2/2] panic: Fix up description of vpanic()
  2025-07-11 11:20 ` [PATCH 2/2] panic: Fix up description of vpanic() Nam Cao
@ 2025-07-15  5:56   ` Masami Hiramatsu
  2025-07-15 13:31     ` Nam Cao
  0 siblings, 1 reply; 9+ messages in thread
From: Masami Hiramatsu @ 2025-07-15  5:56 UTC (permalink / raw)
  To: Nam Cao
  Cc: Steven Rostedt, John Ogness, Mathieu Desnoyers, Gabriele Monaco,
	linux-trace-kernel, Josh Poimboeuf, Peter Zijlstra, Petr Mladek,
	linux-kernel, Stephen Rothwell

On Fri, 11 Jul 2025 13:20:43 +0200
Nam Cao <namcao@linutronix.de> wrote:

> The description above vpanic() has the wrong function name. Fix it up.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/lkml/20250711183802.2d8c124d@canb.auug.org.au/
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> ---
>  kernel/panic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 6a1823c383d0..2a499facde13 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -307,7 +307,7 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
>  }
>  
>  /**
> - * panic - halt the system
> + * vpanic - halt the system

Shouldn't we make a copy the doc for the panic() (keep the text as it is)
and change the short explanation?

panic - halt the system
@fmt: ...

vpanic - halt the system with va_list
@fmt: ...
@args: ...

 From the newbie's viewpoint, as far as we keep providing the same
function, it is better to keep the same document to avoid confusion.

Thanks,


>   * @fmt: The text string to print
>   * @args: Arguments for the format string
>   *
> -- 
> 2.39.5
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

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

* Re: [PATCH 2/2] panic: Fix up description of vpanic()
  2025-07-15  5:56   ` Masami Hiramatsu
@ 2025-07-15 13:31     ` Nam Cao
  0 siblings, 0 replies; 9+ messages in thread
From: Nam Cao @ 2025-07-15 13:31 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Steven Rostedt, John Ogness, Mathieu Desnoyers, Gabriele Monaco,
	linux-trace-kernel, Josh Poimboeuf, Peter Zijlstra, Petr Mladek,
	linux-kernel, Stephen Rothwell

On Tue, Jul 15, 2025 at 02:56:01PM +0900, Masami Hiramatsu wrote:
> On Fri, 11 Jul 2025 13:20:43 +0200
> Nam Cao <namcao@linutronix.de> wrote:
> >  /**
> > - * panic - halt the system
> > + * vpanic - halt the system
> 
> Shouldn't we make a copy the doc for the panic() (keep the text as it is)
> and change the short explanation?
> 
> panic - halt the system
> @fmt: ...
> 
> vpanic - halt the system with va_list
> @fmt: ...
> @args: ...
> 
>  From the newbie's viewpoint, as far as we keep providing the same
> function, it is better to keep the same document to avoid confusion.

That would be nice for sure. But I think the counter arguments are
stronger:

  - Two copies need to be maintained

  - panic() is only a few lines, and it is obvious at first glance that it
    is simply a thin wrapper around vpanic()

So I think it is better to leave it as is.

Best regards,
Nam

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

end of thread, other threads:[~2025-07-15 13:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 11:20 [PATCH 0/2] Fix up build issues with vpanic Nam Cao
2025-07-11 11:20 ` [PATCH 1/2] objtool: Add vpanic() to the noreturn list Nam Cao
2025-07-11 11:20 ` [PATCH 2/2] panic: Fix up description of vpanic() Nam Cao
2025-07-15  5:56   ` Masami Hiramatsu
2025-07-15 13:31     ` Nam Cao
2025-07-11 11:28 ` [PATCH 0/2] Fix up build issues with vpanic Peter Zijlstra
2025-07-11 12:06   ` Nam Cao
2025-07-11 16:24 ` Steven Rostedt
2025-07-11 18:18   ` Peter Zijlstra

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