Linux-parisc archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] parisc: add sysctl file interface panic_on_stackoverflow
@ 2020-04-11 13:06 Xiaoming Ni
  2020-04-16  0:09 ` Luis Chamberlain
  2020-05-08 21:37 ` Helge Deller
  0 siblings, 2 replies; 3+ messages in thread
From: Xiaoming Ni @ 2020-04-11 13:06 UTC (permalink / raw)
  To: mcgrof, keescook, yzaikin, James.Bottomley, deller
  Cc: nixiaoming, linux-kernel, linux-fsdevel, linux-parisc, wangle6,
	victor.lisheng

The variable sysctl_panic_on_stackoverflow is used in
arch/parisc/kernel/irq.c and arch/x86/kernel/irq_32.c, but the sysctl file
interface panic_on_stackoverflow only exists on x86.

Add sysctl file interface panic_on_stackoverflow for parisc

Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
---
 kernel/sysctl.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8a176d8..b9ff323 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -994,30 +994,32 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write,
 		.proc_handler   = proc_dointvec,
 	},
 #endif
-#if defined(CONFIG_X86)
+
+#if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
+	defined(CONFIG_DEBUG_STACKOVERFLOW)
 	{
-		.procname	= "panic_on_unrecovered_nmi",
-		.data		= &panic_on_unrecovered_nmi,
+		.procname	= "panic_on_stackoverflow",
+		.data		= &sysctl_panic_on_stackoverflow,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
+#endif
+#if defined(CONFIG_X86)
 	{
-		.procname	= "panic_on_io_nmi",
-		.data		= &panic_on_io_nmi,
+		.procname	= "panic_on_unrecovered_nmi",
+		.data		= &panic_on_unrecovered_nmi,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
-#ifdef CONFIG_DEBUG_STACKOVERFLOW
 	{
-		.procname	= "panic_on_stackoverflow",
-		.data		= &sysctl_panic_on_stackoverflow,
+		.procname	= "panic_on_io_nmi",
+		.data		= &panic_on_io_nmi,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
-#endif
 	{
 		.procname	= "bootloader_type",
 		.data		= &bootloader_type,
-- 
1.8.5.6


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

* Re: [PATCH] parisc: add sysctl file interface panic_on_stackoverflow
  2020-04-11 13:06 [PATCH] parisc: add sysctl file interface panic_on_stackoverflow Xiaoming Ni
@ 2020-04-16  0:09 ` Luis Chamberlain
  2020-05-08 21:37 ` Helge Deller
  1 sibling, 0 replies; 3+ messages in thread
From: Luis Chamberlain @ 2020-04-16  0:09 UTC (permalink / raw)
  To: Xiaoming Ni, Andrew Morton
  Cc: keescook, yzaikin, James.Bottomley, deller, linux-kernel,
	linux-fsdevel, linux-parisc, wangle6, victor.lisheng

On Sat, Apr 11, 2020 at 09:06:19PM +0800, Xiaoming Ni wrote:
> The variable sysctl_panic_on_stackoverflow is used in
> arch/parisc/kernel/irq.c and arch/x86/kernel/irq_32.c, but the sysctl file
> interface panic_on_stackoverflow only exists on x86.
> 
> Add sysctl file interface panic_on_stackoverflow for parisc
> 
> Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

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

* Re: [PATCH] parisc: add sysctl file interface panic_on_stackoverflow
  2020-04-11 13:06 [PATCH] parisc: add sysctl file interface panic_on_stackoverflow Xiaoming Ni
  2020-04-16  0:09 ` Luis Chamberlain
@ 2020-05-08 21:37 ` Helge Deller
  1 sibling, 0 replies; 3+ messages in thread
From: Helge Deller @ 2020-05-08 21:37 UTC (permalink / raw)
  To: Xiaoming Ni, mcgrof, keescook, yzaikin, James.Bottomley
  Cc: linux-kernel, linux-fsdevel, linux-parisc, wangle6, victor.lisheng

On 11.04.20 15:06, Xiaoming Ni wrote:
> The variable sysctl_panic_on_stackoverflow is used in
> arch/parisc/kernel/irq.c and arch/x86/kernel/irq_32.c, but the sysctl file
> interface panic_on_stackoverflow only exists on x86.
>
> Add sysctl file interface panic_on_stackoverflow for parisc
>
> Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>

Acked-by: Helge Deller <deller@gmx.de>

Helge


> ---
>  kernel/sysctl.c | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 8a176d8..b9ff323 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -994,30 +994,32 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write,
>  		.proc_handler   = proc_dointvec,
>  	},
>  #endif
> -#if defined(CONFIG_X86)
> +
> +#if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
> +	defined(CONFIG_DEBUG_STACKOVERFLOW)
>  	{
> -		.procname	= "panic_on_unrecovered_nmi",
> -		.data		= &panic_on_unrecovered_nmi,
> +		.procname	= "panic_on_stackoverflow",
> +		.data		= &sysctl_panic_on_stackoverflow,
>  		.maxlen		= sizeof(int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec,
>  	},
> +#endif
> +#if defined(CONFIG_X86)
>  	{
> -		.procname	= "panic_on_io_nmi",
> -		.data		= &panic_on_io_nmi,
> +		.procname	= "panic_on_unrecovered_nmi",
> +		.data		= &panic_on_unrecovered_nmi,
>  		.maxlen		= sizeof(int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec,
>  	},
> -#ifdef CONFIG_DEBUG_STACKOVERFLOW
>  	{
> -		.procname	= "panic_on_stackoverflow",
> -		.data		= &sysctl_panic_on_stackoverflow,
> +		.procname	= "panic_on_io_nmi",
> +		.data		= &panic_on_io_nmi,
>  		.maxlen		= sizeof(int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec,
>  	},
> -#endif
>  	{
>  		.procname	= "bootloader_type",
>  		.data		= &bootloader_type,
>


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-11 13:06 [PATCH] parisc: add sysctl file interface panic_on_stackoverflow Xiaoming Ni
2020-04-16  0:09 ` Luis Chamberlain
2020-05-08 21:37 ` Helge Deller

Linux-parisc archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-parisc/0 linux-parisc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-parisc linux-parisc/ https://lore.kernel.org/linux-parisc \
		linux-parisc@vger.kernel.org
	public-inbox-index linux-parisc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-parisc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git