linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] follow up patches for panic_print's generalization
@ 2025-08-15  7:14 Feng Tang
  2025-08-15  7:14 ` [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case Feng Tang
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Feng Tang @ 2025-08-15  7:14 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek, Steven Rostedt, Lance Yang,
	Jonathan Corbet, linux-kernel
  Cc: paulmck, john.ogness, Feng Tang

Generalization of panic_print's dump function [1] has been merged, and
this patchset is to address some remaining issues, like adding note of
the obsoletion of 'panic_print' cmdline parameter, refining the kernel
document for panic_print, and hardening some string management.

Please help to review!

Feng Tang (3):
  lib/sys_info: handle sys_info_mask==0 case
  panic: refine the document for 'panic_print'
  panic: add note that 'panic_print' parameter is deprecated

 .../admin-guide/kernel-parameters.txt         |  2 +-
 Documentation/admin-guide/sysctl/kernel.rst   |  2 +-
 include/linux/moduleparam.h                   | 14 ++++++++++++++
 kernel/panic.c                                | 19 ++++++++++++++++++-
 lib/sys_info.c                                |  5 ++++-
 5 files changed, 38 insertions(+), 4 deletions(-)

-- 
2.43.5


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

* [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case
  2025-08-15  7:14 [PATCH 0/3] follow up patches for panic_print's generalization Feng Tang
@ 2025-08-15  7:14 ` Feng Tang
  2025-08-19  8:34   ` Petr Mladek
  2025-08-15  7:14 ` [PATCH 2/3] panic: refine the document for 'panic_print' Feng Tang
  2025-08-15  7:14 ` [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated Feng Tang
  2 siblings, 1 reply; 19+ messages in thread
From: Feng Tang @ 2025-08-15  7:14 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek, Steven Rostedt, Lance Yang,
	Jonathan Corbet, linux-kernel
  Cc: paulmck, john.ogness, Feng Tang

It is a normal case that bitmask parameter is 0, so pre-initialize the
names[] to null string to cover this case.

Also remove the superfluous "+1" in names[sizeof(sys_info_avail) + 1],
which is needed for 'strlen()', but not for 'sizeof()'.

Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
 lib/sys_info.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/sys_info.c b/lib/sys_info.c
index 5bf503fd7ec1..b2df148971ba 100644
--- a/lib/sys_info.c
+++ b/lib/sys_info.c
@@ -55,7 +55,7 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
 					  void *buffer, size_t *lenp,
 					  loff_t *ppos)
 {
-	char names[sizeof(sys_info_avail) + 1];
+	char names[sizeof(sys_info_avail)];
 	struct ctl_table table;
 	unsigned long *si_bits_global;
 
@@ -81,6 +81,9 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
 		char *delim = "";
 		int i, len = 0;
 
+		/* *si_bits_glabl could be 0 */
+		names[0] = '\0';
+
 		for (i = 0; i < ARRAY_SIZE(si_names); i++) {
 			if (*si_bits_global & si_names[i].bit) {
 				len += scnprintf(names + len, sizeof(names) - len,
-- 
2.43.5


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

* [PATCH 2/3] panic: refine the document for 'panic_print'
  2025-08-15  7:14 [PATCH 0/3] follow up patches for panic_print's generalization Feng Tang
  2025-08-15  7:14 ` [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case Feng Tang
@ 2025-08-15  7:14 ` Feng Tang
  2025-08-19  8:35   ` Petr Mladek
  2025-08-15  7:14 ` [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated Feng Tang
  2 siblings, 1 reply; 19+ messages in thread
From: Feng Tang @ 2025-08-15  7:14 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek, Steven Rostedt, Lance Yang,
	Jonathan Corbet, linux-kernel
  Cc: paulmck, john.ogness, Feng Tang, Askar Safin

User reported current document about SYS_INFO_PANIC_CONSOLE_REPLAY
is confusing, that people could expect all user space console messages
to be replayed.

Specify that only 'kernel' messages will be replayed to solve the confusion.

Reported-by: Askar Safin <safinaskar@zohomail.com>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 2 +-
 Documentation/admin-guide/sysctl/kernel.rst     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 747a55abf494..86f395f2933b 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4589,7 +4589,7 @@
 			bit 2: print timer info
 			bit 3: print locks info if CONFIG_LOCKDEP is on
 			bit 4: print ftrace buffer
-			bit 5: replay all messages on consoles at the end of panic
+			bit 5: replay all kernel messages on consoles at the end of panic
 			bit 6: print all CPUs backtrace (if available in the arch)
 			bit 7: print only tasks in uninterruptible (blocked) state
 			*Be aware* that this option may print a _lot_ of lines,
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 8b49eab937d0..f3ee807b5d8b 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -890,7 +890,7 @@ bit 1  print system memory info
 bit 2  print timer info
 bit 3  print locks info if ``CONFIG_LOCKDEP`` is on
 bit 4  print ftrace buffer
-bit 5  replay all messages on consoles at the end of panic
+bit 5  replay all kernel messages on consoles at the end of panic
 bit 6  print all CPUs backtrace (if available in the arch)
 bit 7  print only tasks in uninterruptible (blocked) state
 =====  ============================================
-- 
2.43.5


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

* [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated
  2025-08-15  7:14 [PATCH 0/3] follow up patches for panic_print's generalization Feng Tang
  2025-08-15  7:14 ` [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case Feng Tang
  2025-08-15  7:14 ` [PATCH 2/3] panic: refine the document for 'panic_print' Feng Tang
@ 2025-08-15  7:14 ` Feng Tang
  2025-08-19  9:48   ` Petr Mladek
  2025-08-19  9:51   ` [PATCH] panic: Clean up message about deprecated 'panic_print' parameter Petr Mladek
  2 siblings, 2 replies; 19+ messages in thread
From: Feng Tang @ 2025-08-15  7:14 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek, Steven Rostedt, Lance Yang,
	Jonathan Corbet, linux-kernel
  Cc: paulmck, john.ogness, Feng Tang

Just like for 'panic_print's systcl interface, add similar note for
setup of kernel cmdline parameter and parameter under /sys/module/kernel/.

Also add __core_param_cb() macro, which enables to add special get/set
operation for a kernel parameter.

Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
 include/linux/moduleparam.h | 14 ++++++++++++++
 kernel/panic.c              | 19 ++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 3a25122d83e2..381c3779244c 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -199,6 +199,7 @@ struct kparam_array
 #define core_param_cb(name, ops, arg, perm)		\
 	__level_param_cb(name, ops, arg, perm, 1)
 
+
 /**
  * postcore_param_cb - general callback for a module/cmdline parameter
  *                     to be evaluated before postcore initcall level
@@ -349,6 +350,19 @@ static inline void kernel_param_unlock(struct module *mod)
 	__module_param_call("", name, &param_ops_##type, &var, perm,	\
 			    -1, KERNEL_PARAM_FL_UNSAFE)
 
+/**
+ * __core_param_cb - similar like core_param, with a set/get ops instead of type.
+ * @name: the name of the cmdline and sysfs parameter (often the same as var)
+ * @var: the variable
+ * @ops: the set & get operations for this parameter.
+ * @perm: visibility in sysfs
+ *
+ * Ideally this should be called 'core_param_cb', but the name has been
+ * used for module core parameter, so add the '__' prefix
+ */
+#define __core_param_cb(name, ops, arg, perm) \
+	__module_param_call("", name, ops, arg, perm, -1, 0)
+
 #endif /* !MODULE */
 
 /**
diff --git a/kernel/panic.c b/kernel/panic.c
index 72fcbb5a071b..12a10e17ab4a 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -937,12 +937,29 @@ EXPORT_SYMBOL(__stack_chk_fail);
 #endif
 
 core_param(panic, panic_timeout, int, 0644);
-core_param(panic_print, panic_print, ulong, 0644);
 core_param(pause_on_oops, pause_on_oops, int, 0644);
 core_param(panic_on_warn, panic_on_warn, int, 0644);
 core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
 core_param(panic_console_replay, panic_console_replay, bool, 0644);
 
+static int panic_print_set(const char *val, const struct kernel_param *kp)
+{
+	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	return  param_set_ulong(val, kp);
+}
+
+static int panic_print_get(char *val, const struct kernel_param *kp)
+{
+	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	return  param_get_ulong(val, kp);
+}
+
+static const struct kernel_param_ops panic_print_ops = {
+	.set	= panic_print_set,
+	.get	= panic_print_get,
+};
+__core_param_cb(panic_print, &panic_print_ops, &panic_print, 0644);
+
 static int __init oops_setup(char *s)
 {
 	if (!s)
-- 
2.43.5


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

* Re: [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case
  2025-08-15  7:14 ` [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case Feng Tang
@ 2025-08-19  8:34   ` Petr Mladek
  2025-08-25  1:05     ` Feng Tang
  0 siblings, 1 reply; 19+ messages in thread
From: Petr Mladek @ 2025-08-19  8:34 UTC (permalink / raw)
  To: Feng Tang
  Cc: Andrew Morton, Steven Rostedt, Lance Yang, Jonathan Corbet,
	linux-kernel, paulmck, john.ogness

On Fri 2025-08-15 15:14:26, Feng Tang wrote:
> It is a normal case that bitmask parameter is 0, so pre-initialize the
> names[] to null string to cover this case.
> 
> Also remove the superfluous "+1" in names[sizeof(sys_info_avail) + 1],
> which is needed for 'strlen()', but not for 'sizeof()'.
> 
> --- a/lib/sys_info.c
> +++ b/lib/sys_info.c
> @@ -55,7 +55,7 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
>  					  void *buffer, size_t *lenp,
>  					  loff_t *ppos)
>  {
> -	char names[sizeof(sys_info_avail) + 1];
> +	char names[sizeof(sys_info_avail)];
>  	struct ctl_table table;
>  	unsigned long *si_bits_global;
>  
> @@ -81,6 +81,9 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
>  		char *delim = "";
>  		int i, len = 0;
>  
> +		/* *si_bits_glabl could be 0 */

s/si_bits_glabl/si_bits_global/

But I would personally remove the comment completely. IMHO, the
purpose is quite obvious. But I do not resist on it.

> +		names[0] = '\0';
> +
>  		for (i = 0; i < ARRAY_SIZE(si_names); i++) {
>  			if (*si_bits_global & si_names[i].bit) {
>  				len += scnprintf(names + len, sizeof(names) - len,

Otherwise, it looks good to me:

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

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

* Re: [PATCH 2/3] panic: refine the document for 'panic_print'
  2025-08-15  7:14 ` [PATCH 2/3] panic: refine the document for 'panic_print' Feng Tang
@ 2025-08-19  8:35   ` Petr Mladek
  0 siblings, 0 replies; 19+ messages in thread
From: Petr Mladek @ 2025-08-19  8:35 UTC (permalink / raw)
  To: Feng Tang
  Cc: Andrew Morton, Steven Rostedt, Lance Yang, Jonathan Corbet,
	linux-kernel, paulmck, john.ogness, Askar Safin

On Fri 2025-08-15 15:14:27, Feng Tang wrote:
> User reported current document about SYS_INFO_PANIC_CONSOLE_REPLAY
> is confusing, that people could expect all user space console messages
> to be replayed.
> 
> Specify that only 'kernel' messages will be replayed to solve the confusion.
> 
> Reported-by: Askar Safin <safinaskar@zohomail.com>
> Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>

Looks good to me:

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

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

* Re: [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated
  2025-08-15  7:14 ` [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated Feng Tang
@ 2025-08-19  9:48   ` Petr Mladek
  2025-08-19  9:51   ` [PATCH] panic: Clean up message about deprecated 'panic_print' parameter Petr Mladek
  1 sibling, 0 replies; 19+ messages in thread
From: Petr Mladek @ 2025-08-19  9:48 UTC (permalink / raw)
  To: Feng Tang
  Cc: Andrew Morton, Steven Rostedt, Lance Yang, Jonathan Corbet,
	linux-kernel, paulmck, john.ogness

On Fri 2025-08-15 15:14:28, Feng Tang wrote:
> Just like for 'panic_print's systcl interface, add similar note for
> setup of kernel cmdline parameter and parameter under /sys/module/kernel/.
> 
> Also add __core_param_cb() macro, which enables to add special get/set
> operation for a kernel parameter.



> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -937,12 +937,29 @@ EXPORT_SYMBOL(__stack_chk_fail);
>  #endif
>  
>  core_param(panic, panic_timeout, int, 0644);
> -core_param(panic_print, panic_print, ulong, 0644);
>  core_param(pause_on_oops, pause_on_oops, int, 0644);
>  core_param(panic_on_warn, panic_on_warn, int, 0644);
>  core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
>  core_param(panic_console_replay, panic_console_replay, bool, 0644);
>  
> +static int panic_print_set(const char *val, const struct kernel_param *kp)
> +{
> +	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	return  param_set_ulong(val, kp);
> +}
> +
> +static int panic_print_get(char *val, const struct kernel_param *kp)
> +{
> +	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	return  param_get_ulong(val, kp);
> +}

It should be enough to print the message only once and avoid
duplication in the sources.

Also I would make the message more direct, something like:

	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");

I am going to send a followup patch. Feel free to keep this one as is:

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

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

* [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-15  7:14 ` [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated Feng Tang
  2025-08-19  9:48   ` Petr Mladek
@ 2025-08-19  9:51   ` Petr Mladek
  2025-08-19 13:58     ` Lance Yang
  2025-08-20  1:31     ` kernel test robot
  1 sibling, 2 replies; 19+ messages in thread
From: Petr Mladek @ 2025-08-19  9:51 UTC (permalink / raw)
  To: Feng Tang
  Cc: Andrew Morton, Steven Rostedt, Lance Yang, Jonathan Corbet,
	linux-kernel, paulmck, john.ogness

Remove duplication of the message about the deprecated 'panic_print'
parameter.

Also make the wording more direct. Make it clear that the new
parameters already exist and should be used instead.

Signed-off-by: Petr Mladek <pmladek@suse.com>
---
This can be used as a follow up patch.
Or feel free to squash it into the 3rd patch.

kernel/panic.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 12a10e17ab4a..d3907fd95d72 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -122,10 +122,15 @@ static int proc_taint(const struct ctl_table *table, int write,
 	return err;
 }
 
+static void panic_print_deprecated(void)
+{
+	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
 static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
 			   void *buffer, size_t *lenp, loff_t *ppos)
 {
-	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	panic_print_deprecated();
 	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 }
 
@@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
 
 static int panic_print_set(const char *val, const struct kernel_param *kp)
 {
-	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	panic_print_deprecated();
 	return  param_set_ulong(val, kp);
 }
 
 static int panic_print_get(char *val, const struct kernel_param *kp)
 {
-	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	panic_print_deprecated();
 	return  param_get_ulong(val, kp);
 }
 
-- 
2.50.1


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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-19  9:51   ` [PATCH] panic: Clean up message about deprecated 'panic_print' parameter Petr Mladek
@ 2025-08-19 13:58     ` Lance Yang
  2025-08-20  1:31     ` kernel test robot
  1 sibling, 0 replies; 19+ messages in thread
From: Lance Yang @ 2025-08-19 13:58 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Andrew Morton, Steven Rostedt, Jonathan Corbet, linux-kernel,
	paulmck, john.ogness, Feng Tang



On 2025/8/19 17:51, Petr Mladek wrote:
> Remove duplication of the message about the deprecated 'panic_print'
> parameter.
> 
> Also make the wording more direct. Make it clear that the new
> parameters already exist and should be used instead.
> 
> Signed-off-by: Petr Mladek <pmladek@suse.com>

Nice cleanup! This makes the code cleaner and the message
more direct. So, feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>

Thanks,
Lance

> ---
> This can be used as a follow up patch.
> Or feel free to squash it into the 3rd patch.
> 
> kernel/panic.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 12a10e17ab4a..d3907fd95d72 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -122,10 +122,15 @@ static int proc_taint(const struct ctl_table *table, int write,
>   	return err;
>   }
>   
> +static void panic_print_deprecated(void)
> +{
> +	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
> +}
> +
>   static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
>   			   void *buffer, size_t *lenp, loff_t *ppos)
>   {
> -	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	panic_print_deprecated();
>   	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
>   }
>   
> @@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
>   
>   static int panic_print_set(const char *val, const struct kernel_param *kp)
>   {
> -	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	panic_print_deprecated();
>   	return  param_set_ulong(val, kp);
>   }
>   
>   static int panic_print_get(char *val, const struct kernel_param *kp)
>   {
> -	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	panic_print_deprecated();
>   	return  param_get_ulong(val, kp);
>   }
>   


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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-19  9:51   ` [PATCH] panic: Clean up message about deprecated 'panic_print' parameter Petr Mladek
  2025-08-19 13:58     ` Lance Yang
@ 2025-08-20  1:31     ` kernel test robot
  2025-08-20  1:54       ` Lance Yang
  1 sibling, 1 reply; 19+ messages in thread
From: kernel test robot @ 2025-08-20  1:31 UTC (permalink / raw)
  To: Petr Mladek, Feng Tang
  Cc: llvm, oe-kbuild-all, Andrew Morton, Linux Memory Management List,
	Steven Rostedt, Lance Yang, Jonathan Corbet, linux-kernel,
	paulmck, john.ogness

Hi Petr,

kernel test robot noticed the following build errors:



url:    https://github.com/intel-lab-lkp/linux/commits/UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0-case/20250815-152131
base:   the 3th patch of https://lore.kernel.org/r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
patch link:    https://lore.kernel.org/r/aKRJKZHgcxyNF3y7%40pathway.suse.cz
patch subject: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
config: i386-buildonly-randconfig-004-20250820 (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/panic.c:952:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     952 |         panic_print_deprecated();
         |         ^
   kernel/panic.c:958:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     958 |         panic_print_deprecated();
         |         ^
   2 errors generated.


vim +/panic_print_deprecated +952 kernel/panic.c

   949	
   950	static int panic_print_set(const char *val, const struct kernel_param *kp)
   951	{
 > 952		panic_print_deprecated();
   953		return  param_set_ulong(val, kp);
   954	}
   955	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  1:31     ` kernel test robot
@ 2025-08-20  1:54       ` Lance Yang
  2025-08-20  1:56         ` Lance Yang
  0 siblings, 1 reply; 19+ messages in thread
From: Lance Yang @ 2025-08-20  1:54 UTC (permalink / raw)
  To: kernel test robot, Petr Mladek, Feng Tang
  Cc: llvm, oe-kbuild-all, Andrew Morton, Linux Memory Management List,
	Steven Rostedt, Jonathan Corbet, linux-kernel, paulmck,
	john.ogness



On 2025/8/20 09:31, kernel test robot wrote:
> Hi Petr,
> 
> kernel test robot noticed the following build errors:
> 
> 
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0-case/20250815-152131
> base:   the 3th patch of https://lore.kernel.org/r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
> patch link:    https://lore.kernel.org/r/aKRJKZHgcxyNF3y7%40pathway.suse.cz
> patch subject: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
> config: i386-buildonly-randconfig-004-20250820 (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>>> kernel/panic.c:952:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>       952 |         panic_print_deprecated();
>           |         ^
>     kernel/panic.c:958:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>       958 |         panic_print_deprecated();
>           |         ^
>     2 errors generated.


Oops, panic_print_deprecated() is defined within the #ifdef
CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
and panic_print_get(), which are outside of that block.

So, we need to move the definition out of the block to a common
scope where all its callers can see it. @Petr wdyt?

Thanks,
Lance

> 
> 
> vim +/panic_print_deprecated +952 kernel/panic.c
> 
>     949	
>     950	static int panic_print_set(const char *val, const struct kernel_param *kp)
>     951	{
>   > 952		panic_print_deprecated();
>     953		return  param_set_ulong(val, kp);
>     954	}
>     955	
> 


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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  1:54       ` Lance Yang
@ 2025-08-20  1:56         ` Lance Yang
  2025-08-20  8:57           ` Lance Yang
  0 siblings, 1 reply; 19+ messages in thread
From: Lance Yang @ 2025-08-20  1:56 UTC (permalink / raw)
  To: kernel test robot, Petr Mladek, Feng Tang
  Cc: llvm, oe-kbuild-all, Andrew Morton, Linux Memory Management List,
	Steven Rostedt, Jonathan Corbet, linux-kernel, paulmck,
	john.ogness



On 2025/8/20 09:54, Lance Yang wrote:
> 
> 
> On 2025/8/20 09:31, kernel test robot wrote:
>> Hi Petr,
>>
>> kernel test robot noticed the following build errors:
>>
>>
>>
>> url:    https://github.com/intel-lab-lkp/linux/commits/ 
>> UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0- 
>> case/20250815-152131
>> base:   the 3th patch of https://lore.kernel.org/ 
>> r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
>> patch link:    https://lore.kernel.org/r/ 
>> aKRJKZHgcxyNF3y7%40pathway.suse.cz
>> patch subject: [PATCH] panic: Clean up message about deprecated 
>> 'panic_print' parameter
>> config: i386-buildonly-randconfig-004-20250820 (https:// 
>> download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub- 
>> lkp@intel.com/config)
>> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 
>> 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/ 
>> archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new 
>> version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub- 
>> lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>>>> kernel/panic.c:952:2: error: call to undeclared function 
>>>> 'panic_print_deprecated'; ISO C99 and later do not support implicit 
>>>> function declarations [-Wimplicit-function-declaration]
>>       952 |         panic_print_deprecated();
>>           |         ^
>>     kernel/panic.c:958:2: error: call to undeclared function 
>> 'panic_print_deprecated'; ISO C99 and later do not support implicit 
>> function declarations [-Wimplicit-function-declaration]
>>       958 |         panic_print_deprecated();
>>           |         ^
>>     2 errors generated.
> 
> 
> Oops, panic_print_deprecated() is defined within the #ifdef
> CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()

Correction:

CONFIG_SYSCTL block - sorry ;(

> and panic_print_get(), which are outside of that block.
> 
> So, we need to move the definition out of the block to a common
> scope where all its callers can see it. @Petr wdyt?
> 
> Thanks,
> Lance
> 
>>
>>
>> vim +/panic_print_deprecated +952 kernel/panic.c
>>
>>     949
>>     950    static int panic_print_set(const char *val, const struct 
>> kernel_param *kp)
>>     951    {
>>   > 952        panic_print_deprecated();
>>     953        return  param_set_ulong(val, kp);
>>     954    }
>>     955
>>
> 


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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  1:56         ` Lance Yang
@ 2025-08-20  8:57           ` Lance Yang
  2025-08-20  9:33             ` Petr Mladek
  0 siblings, 1 reply; 19+ messages in thread
From: Lance Yang @ 2025-08-20  8:57 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Steven Rostedt,
	Jonathan Corbet, linux-kernel, paulmck, john.ogness,
	kernel test robot, Feng Tang



On 2025/8/20 09:56, Lance Yang wrote:
> 
> 
> On 2025/8/20 09:54, Lance Yang wrote:
>>
>>
>> On 2025/8/20 09:31, kernel test robot wrote:
>>> Hi Petr,
>>>
>>> kernel test robot noticed the following build errors:
>>>
>>>
>>>
>>> url:    https://github.com/intel-lab-lkp/linux/commits/ 
>>> UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0- 
>>> case/20250815-152131
>>> base:   the 3th patch of https://lore.kernel.org/ 
>>> r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
>>> patch link:    https://lore.kernel.org/r/ 
>>> aKRJKZHgcxyNF3y7%40pathway.suse.cz
>>> patch subject: [PATCH] panic: Clean up message about deprecated 
>>> 'panic_print' parameter
>>> config: i386-buildonly-randconfig-004-20250820 (https:// 
>>> download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub- 
>>> lkp@intel.com/config)
>>> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 
>>> 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/ 
>>> archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new 
>>> version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: https://lore.kernel.org/oe-kbuild- 
>>> all/202508200907.PsZ3geub- lkp@intel.com/
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>>>> kernel/panic.c:952:2: error: call to undeclared function 
>>>>> 'panic_print_deprecated'; ISO C99 and later do not support implicit 
>>>>> function declarations [-Wimplicit-function-declaration]
>>>       952 |         panic_print_deprecated();
>>>           |         ^
>>>     kernel/panic.c:958:2: error: call to undeclared function 
>>> 'panic_print_deprecated'; ISO C99 and later do not support implicit 
>>> function declarations [-Wimplicit-function-declaration]
>>>       958 |         panic_print_deprecated();
>>>           |         ^
>>>     2 errors generated.
>>
>>
>> Oops, panic_print_deprecated() is defined within the #ifdef
>> CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
> 
> Correction:
> 
> CONFIG_SYSCTL block - sorry ;(
> 
>> and panic_print_get(), which are outside of that block.
>>
>> So, we need to move the definition out of the block to a common
>> scope where all its callers can see it. @Petr wdyt?
>>

If Petr is cool, @Andrew could you squash the following?

---
Subject: [PATCH 1/1] fixup: panic: clean up message about deprecated
  'panic_print' parameter

From: Lance Yang <lance.yang@linux.dev>

Moving the definition out of the CONFIG_SYSCTL block to a common scope
where all its callers can see it.

Reported-by: kernel test robot <lkp@intel.com>
Closes: 
https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
Signed-off-by: Lance Yang <lance.yang@linux.dev>
---
  kernel/panic.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index d3907fd95d72..24bca263f896 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);

  EXPORT_SYMBOL(panic_notifier_list);

+static void panic_print_deprecated(void)
+{
+	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. 
Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
  #ifdef CONFIG_SYSCTL

  /*
@@ -122,11 +127,6 @@ static int proc_taint(const struct ctl_table 
*table, int write,
  	return err;
  }

-static void panic_print_deprecated(void)
-{
-	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. 
Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
-}
-
  static int sysctl_panic_print_handler(const struct ctl_table *table, 
int write,
  			   void *buffer, size_t *lenp, loff_t *ppos)
  {
--
2.49.0


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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  8:57           ` Lance Yang
@ 2025-08-20  9:33             ` Petr Mladek
  2025-08-20  9:40               ` [PATCH v2] " Petr Mladek
  2025-08-20 10:39               ` [PATCH] " Lance Yang
  0 siblings, 2 replies; 19+ messages in thread
From: Petr Mladek @ 2025-08-20  9:33 UTC (permalink / raw)
  To: Lance Yang, Andrew Morton
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Steven Rostedt,
	Jonathan Corbet, linux-kernel, paulmck, john.ogness,
	kernel test robot, Feng Tang

On Wed 2025-08-20 16:57:48, Lance Yang wrote:
> On 2025/8/20 09:56, Lance Yang wrote:
> > On 2025/8/20 09:54, Lance Yang wrote:
> > > On 2025/8/20 09:31, kernel test robot wrote:
> > > > All errors (new ones prefixed by >>):
> > > > 
> > > > > > kernel/panic.c:952:2: error: call to undeclared function
> > > > > > 'panic_print_deprecated'; ISO C99 and later do not
> > > > > > support implicit function declarations
> > > > > > [-Wimplicit-function-declaration]
> > > >       952 |         panic_print_deprecated();
> > > >           |         ^
> > > >     kernel/panic.c:958:2: error: call to undeclared function
> > > > 'panic_print_deprecated'; ISO C99 and later do not support
> > > > implicit function declarations [-Wimplicit-function-declaration]
> > > >       958 |         panic_print_deprecated();
> > > >           |         ^
> > > >     2 errors generated.
> > > 
> > > 
> > > Oops, panic_print_deprecated() is defined within the #ifdef
> > > CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
> > 
> 
> If Petr is cool, @Andrew could you squash the following?
> 
> ---
> Subject: [PATCH 1/1] fixup: panic: clean up message about deprecated
>  'panic_print' parameter

The patch was malformed probably by your mail client.
Below is the fixed and revied variant.
I am going to resend also the squashed version.

Here is the fixed followup patch:

From 35ded31e9ff2c9925d7a78472115c9929b582c63 Mon Sep 17 00:00:00 2001
From: Lance Yang <lance.yang@linux.dev>
Date: Wed, 20 Aug 2025 11:25:31 +0200
Subject: [PATCH] fixup: panic: clean up message about deprecated 'panic_print'
 parameter

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Petr Mladek <pmladek@suse.com>
---
 kernel/panic.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index d3907fd95d72..24bca263f896 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
 
 EXPORT_SYMBOL(panic_notifier_list);
 
+static void panic_print_deprecated(void)
+{
+	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
 #ifdef CONFIG_SYSCTL
 
 /*
@@ -122,11 +127,6 @@ static int proc_taint(const struct ctl_table *table, int write,
 	return err;
 }
 
-static void panic_print_deprecated(void)
-{
-	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
-}
-
 static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
 			   void *buffer, size_t *lenp, loff_t *ppos)
 {
-- 
2.50.1


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

* [PATCH v2] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  9:33             ` Petr Mladek
@ 2025-08-20  9:40               ` Petr Mladek
  2025-08-20 11:03                 ` Lance Yang
  2025-08-25  1:01                 ` Feng Tang
  2025-08-20 10:39               ` [PATCH] " Lance Yang
  1 sibling, 2 replies; 19+ messages in thread
From: Petr Mladek @ 2025-08-20  9:40 UTC (permalink / raw)
  To: Lance Yang, Andrew Morton
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Steven Rostedt,
	Jonathan Corbet, linux-kernel, paulmck, john.ogness,
	kernel test robot, Feng Tang

Remove duplication of the message about deprecated 'panic_print'
parameter.

Also make the wording more direct. Make it clear that the new
parameters already exist and should be used instead.

Signed-off-by: Petr Mladek <pmladek@suse.com>
---
Changes since v1:

  - fixed compilation with CONFIG_SYSCTL disabled (kernel test
    robot <lkp@intel.com>)

Thanks Lance Yang <lance.yang@linux.dev> for debugging the compilation
error reported by the test robot.

 kernel/panic.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 12a10e17ab4a..24bca263f896 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
 
 EXPORT_SYMBOL(panic_notifier_list);
 
+static void panic_print_deprecated(void)
+{
+	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
 #ifdef CONFIG_SYSCTL
 
 /*
@@ -125,7 +130,7 @@ static int proc_taint(const struct ctl_table *table, int write,
 static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
 			   void *buffer, size_t *lenp, loff_t *ppos)
 {
-	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	panic_print_deprecated();
 	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 }
 
@@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
 
 static int panic_print_set(const char *val, const struct kernel_param *kp)
 {
-	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	panic_print_deprecated();
 	return  param_set_ulong(val, kp);
 }
 
 static int panic_print_get(char *val, const struct kernel_param *kp)
 {
-	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+	panic_print_deprecated();
 	return  param_get_ulong(val, kp);
 }
 
-- 
2.50.1


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

* Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  9:33             ` Petr Mladek
  2025-08-20  9:40               ` [PATCH v2] " Petr Mladek
@ 2025-08-20 10:39               ` Lance Yang
  1 sibling, 0 replies; 19+ messages in thread
From: Lance Yang @ 2025-08-20 10:39 UTC (permalink / raw)
  To: Petr Mladek, Andrew Morton
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Steven Rostedt,
	Jonathan Corbet, linux-kernel, paulmck, john.ogness,
	kernel test robot, Feng Tang



On 2025/8/20 17:33, Petr Mladek wrote:
> On Wed 2025-08-20 16:57:48, Lance Yang wrote:
>> On 2025/8/20 09:56, Lance Yang wrote:
>>> On 2025/8/20 09:54, Lance Yang wrote:
>>>> On 2025/8/20 09:31, kernel test robot wrote:
>>>>> All errors (new ones prefixed by >>):
>>>>>
>>>>>>> kernel/panic.c:952:2: error: call to undeclared function
>>>>>>> 'panic_print_deprecated'; ISO C99 and later do not
>>>>>>> support implicit function declarations
>>>>>>> [-Wimplicit-function-declaration]
>>>>>        952 |         panic_print_deprecated();
>>>>>            |         ^
>>>>>      kernel/panic.c:958:2: error: call to undeclared function
>>>>> 'panic_print_deprecated'; ISO C99 and later do not support
>>>>> implicit function declarations [-Wimplicit-function-declaration]
>>>>>        958 |         panic_print_deprecated();
>>>>>            |         ^
>>>>>      2 errors generated.
>>>>
>>>>
>>>> Oops, panic_print_deprecated() is defined within the #ifdef
>>>> CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
>>>
>>
>> If Petr is cool, @Andrew could you squash the following?
>>
>> ---
>> Subject: [PATCH 1/1] fixup: panic: clean up message about deprecated
>>   'panic_print' parameter
> 
> The patch was malformed probably by your mail client.
> Below is the fixed and revied variant.

Yes. My client messed up the formatting - git send-email it is ;)

Thanks,
Lance

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

* Re: [PATCH v2] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  9:40               ` [PATCH v2] " Petr Mladek
@ 2025-08-20 11:03                 ` Lance Yang
  2025-08-25  1:01                 ` Feng Tang
  1 sibling, 0 replies; 19+ messages in thread
From: Lance Yang @ 2025-08-20 11:03 UTC (permalink / raw)
  To: Petr Mladek, Andrew Morton
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Steven Rostedt,
	Jonathan Corbet, linux-kernel, paulmck, john.ogness,
	kernel test robot, Feng Tang



On 2025/8/20 17:40, Petr Mladek wrote:
> Remove duplication of the message about deprecated 'panic_print'
> parameter.
> 
> Also make the wording more direct. Make it clear that the new
> parameters already exist and should be used instead.
> 
> Signed-off-by: Petr Mladek <pmladek@suse.com>

Confirmed that it fixes the build error when CONFIG_SYSCTL is
disabled.

Tested-by: Lance Yang <lance.yang@linux.dev>

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

* Re: [PATCH v2] panic: Clean up message about deprecated 'panic_print' parameter
  2025-08-20  9:40               ` [PATCH v2] " Petr Mladek
  2025-08-20 11:03                 ` Lance Yang
@ 2025-08-25  1:01                 ` Feng Tang
  1 sibling, 0 replies; 19+ messages in thread
From: Feng Tang @ 2025-08-25  1:01 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Lance Yang, Andrew Morton, llvm, oe-kbuild-all,
	Linux Memory Management List, Steven Rostedt, Jonathan Corbet,
	linux-kernel, paulmck, john.ogness, kernel test robot

On Wed, Aug 20, 2025 at 11:40:32AM +0200, Petr Mladek wrote:
> Remove duplication of the message about deprecated 'panic_print'
> parameter.
> 
> Also make the wording more direct. Make it clear that the new
> parameters already exist and should be used instead.
> 
> Signed-off-by: Petr Mladek <pmladek@suse.com>

Thanks for the cleanup!

Reviewed-by: Feng Tang <feng.tang@linux.alibaba.com>

> ---
> Changes since v1:
> 
>   - fixed compilation with CONFIG_SYSCTL disabled (kernel test
>     robot <lkp@intel.com>)
> 
> Thanks Lance Yang <lance.yang@linux.dev> for debugging the compilation
> error reported by the test robot.
> 
>  kernel/panic.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 12a10e17ab4a..24bca263f896 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
>  
>  EXPORT_SYMBOL(panic_notifier_list);
>  
> +static void panic_print_deprecated(void)
> +{
> +	pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
> +}
> +
>  #ifdef CONFIG_SYSCTL
>  
>  /*
> @@ -125,7 +130,7 @@ static int proc_taint(const struct ctl_table *table, int write,
>  static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
>  			   void *buffer, size_t *lenp, loff_t *ppos)
>  {
> -	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	panic_print_deprecated();
>  	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
>  }
>  
> @@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
>  
>  static int panic_print_set(const char *val, const struct kernel_param *kp)
>  {
> -	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	panic_print_deprecated();
>  	return  param_set_ulong(val, kp);
>  }
>  
>  static int panic_print_get(char *val, const struct kernel_param *kp)
>  {
> -	pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> +	panic_print_deprecated();
>  	return  param_get_ulong(val, kp);
>  }
>  
> -- 
> 2.50.1

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

* Re: [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case
  2025-08-19  8:34   ` Petr Mladek
@ 2025-08-25  1:05     ` Feng Tang
  0 siblings, 0 replies; 19+ messages in thread
From: Feng Tang @ 2025-08-25  1:05 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Andrew Morton, Steven Rostedt, Lance Yang, Jonathan Corbet,
	linux-kernel, paulmck, john.ogness

On Tue, Aug 19, 2025 at 10:34:14AM +0200, Petr Mladek wrote:
> On Fri 2025-08-15 15:14:26, Feng Tang wrote:
> > It is a normal case that bitmask parameter is 0, so pre-initialize the
> > names[] to null string to cover this case.
> > 
> > Also remove the superfluous "+1" in names[sizeof(sys_info_avail) + 1],
> > which is needed for 'strlen()', but not for 'sizeof()'.
> > 
> > --- a/lib/sys_info.c
> > +++ b/lib/sys_info.c
> > @@ -55,7 +55,7 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
> >  					  void *buffer, size_t *lenp,
> >  					  loff_t *ppos)
> >  {
> > -	char names[sizeof(sys_info_avail) + 1];
> > +	char names[sizeof(sys_info_avail)];
> >  	struct ctl_table table;
> >  	unsigned long *si_bits_global;
> >  
> > @@ -81,6 +81,9 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
> >  		char *delim = "";
> >  		int i, len = 0;
> >  
> > +		/* *si_bits_glabl could be 0 */
> 
> s/si_bits_glabl/si_bits_global/
> 
> But I would personally remove the comment completely. IMHO, the
> purpose is quite obvious. But I do not resist on it.

Will remove.

> 
> > +		names[0] = '\0';
> > +
> >  		for (i = 0; i < ARRAY_SIZE(si_names); i++) {
> >  			if (*si_bits_global & si_names[i].bit) {
> >  				len += scnprintf(names + len, sizeof(names) - len,
> 
> Otherwise, it looks good to me:
> 
> Reviewed-by: Petr Mladek <pmladek@suse.com>

Thank you! will resend a v2 patchset. 

- Feng

> 
> Best Regards,
> Petr

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

end of thread, other threads:[~2025-08-25  1:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15  7:14 [PATCH 0/3] follow up patches for panic_print's generalization Feng Tang
2025-08-15  7:14 ` [PATCH 1/3] lib/sys_info: handle sys_info_mask==0 case Feng Tang
2025-08-19  8:34   ` Petr Mladek
2025-08-25  1:05     ` Feng Tang
2025-08-15  7:14 ` [PATCH 2/3] panic: refine the document for 'panic_print' Feng Tang
2025-08-19  8:35   ` Petr Mladek
2025-08-15  7:14 ` [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated Feng Tang
2025-08-19  9:48   ` Petr Mladek
2025-08-19  9:51   ` [PATCH] panic: Clean up message about deprecated 'panic_print' parameter Petr Mladek
2025-08-19 13:58     ` Lance Yang
2025-08-20  1:31     ` kernel test robot
2025-08-20  1:54       ` Lance Yang
2025-08-20  1:56         ` Lance Yang
2025-08-20  8:57           ` Lance Yang
2025-08-20  9:33             ` Petr Mladek
2025-08-20  9:40               ` [PATCH v2] " Petr Mladek
2025-08-20 11:03                 ` Lance Yang
2025-08-25  1:01                 ` Feng Tang
2025-08-20 10:39               ` [PATCH] " Lance Yang

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