public inbox for linux-parisc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sysctl: convert arch specific unaligned access regulators to generic ones
       [not found] ` <1356001898-2960-1-git-send-email-vgupta@synopsys.com>
@ 2012-12-20 11:11   ` Vineet.Gupta1
  0 siblings, 0 replies; 4+ messages in thread
From: Vineet.Gupta1 @ 2012-12-20 11:11 UTC (permalink / raw)
  To: linux-arch
  Cc: Vineet Gupta, Tony Luck, Fenghua Yu, James E.J. Bottomley,
	Eric W. Biederman, Serge Hallyn, David S. Miller,
	Paul E. McKenney, linux-ia64, linux-parisc, linux-kernel

From: Vineet Gupta <vgupta@synopsys.com>

* parisc: /proc/sys/kernel/unaligned-trap => SYSCTL_ARCH_UNALIGN_ALLOW

* ia64: /proc/sys/kernel/ignore-unaligned-usertrap =>
					SYSCTL_ARCH_UNALIGN_NO_WARN

This allows other architectures, specifically ARC to reuse these sysctl
knobs.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-ia64@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 arch/ia64/Kconfig   |    1 +
 arch/parisc/Kconfig |    1 +
 init/Kconfig        |   16 ++++++++++++++++
 kernel/sysctl.c     |   16 +++++++++++++---
 4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 3279646..5fb1064 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -40,6 +40,7 @@ config IA64
 	select ARCH_THREAD_INFO_ALLOCATOR
 	select ARCH_CLOCKSOURCE_DATA
 	select GENERIC_TIME_VSYSCALL_OLD
+	select SYSCTL_ARCH_UNALIGN_NO_WARN
 	select HAVE_MOD_ARCH_SPECIFIC
 	select MODULES_USE_ELF_RELA
 	default y
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 11def45..7d9de54 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -20,6 +20,7 @@ config PARISC
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select GENERIC_SMP_IDLE_THREAD
 	select GENERIC_STRNCPY_FROM_USER
+	select SYSCTL_ARCH_UNALIGN_ALLOW
 	select HAVE_MOD_ARCH_SPECIFIC
 	select MODULES_USE_ELF_RELA
 
diff --git a/init/Kconfig b/init/Kconfig
index 6fdd6e3..de4b184 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1169,6 +1169,22 @@ config SYSCTL_EXCEPTION_TRACE
 	help
 	  Enable support for /proc/sys/debug/exception-trace.
 
+config SYSCTL_ARCH_UNALIGN_NO_WARN
+	bool
+	help
+	  Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
+	  Allows arch to define/use @no_unaligned_warning to possbly warn about
+	  unaligned access emulation going on under the hood.
+	  see arch/ia64/kernel/unaligned.c for reference
+
+config SYSCTL_ARCH_UNALIGN_ALLOW
+	bool
+	help
+	  Enable support for /proc/sys/kernel/unaligned-trap
+	  Allows arches to define/use @unaligned_enabled to runtime toggle
+	  the unaligned access emulation.
+	  see arch/parisc/kernel/unaligned.c for reference
+
 config KALLSYMS
 	 bool "Load all symbols for debugging/ksymoops" if EXPERT
 	 default y
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 26f65ea..9c618bf 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -157,14 +157,20 @@ extern int sysctl_tsb_ratio;
 
 #ifdef __hppa__
 extern int pwrsw_enabled;
-extern int unaligned_enabled;
 #endif
 
 #ifdef CONFIG_IA64
-extern int no_unaligned_warning;
 extern int unaligned_dump_stack;
 #endif
 
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
+extern int unaligned_enabled;
+#endif
+
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
+extern int no_unaligned_warning;
+#endif
+
 #ifdef CONFIG_PROC_SYSCTL
 static int proc_do_cad_pid(struct ctl_table *table, int write,
 		  void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -504,6 +510,8 @@ static struct ctl_table kern_table[] = {
 	 	.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
+#endif
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
 	{
 		.procname	= "unaligned-trap",
 		.data		= &unaligned_enabled,
@@ -870,7 +878,7 @@ static struct ctl_table kern_table[] = {
 		.proc_handler	= proc_doulongvec_minmax,
 	},
 #endif
-#ifdef CONFIG_IA64
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
 	{
 		.procname	= "ignore-unaligned-usertrap",
 		.data		= &no_unaligned_warning,
@@ -878,6 +886,8 @@ static struct ctl_table kern_table[] = {
 	 	.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
+#endif
+#ifdef CONFIG_IA64
 	{
 		.procname	= "unaligned-dump-stack",
 		.data		= &unaligned_dump_stack,
-- 
1.7.4.1

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

* [RESEND PATCH] Convert PARISC sysctl to be generic
       [not found] <50D2B75A.3000208@synopsys.com>
       [not found] ` <1356001898-2960-1-git-send-email-vgupta@synopsys.com>
@ 2013-01-03  6:59 ` Vineet Gupta
  2013-01-03  6:59   ` [RESEND PATCH] sysctl: Enable PARISC "unaligned-trap" to be used cross-arch Vineet Gupta
  1 sibling, 1 reply; 4+ messages in thread
From: Vineet Gupta @ 2013-01-03  6:59 UTC (permalink / raw)
  To: James E.J. Bottomley, Helge Deller
  Cc: linux-kernel, linux-parisc, linux-arch, arnd, Vineet Gupta

Hi,

This came out ARC Port's review by Arnd where he suggested using the existing
sysctl knobs in parisc and/or ia64 for runtime controlling unaligned access
emulation.

Turns out that ARC port needs bit of both.

The common sysctl knobs are now #ifdef based on init/Kconfig options which
the corresponding arches now select in their Kconfigs.
No other arch code is touched (although code has not been compile tested).

If this patch is ACKable, I would request you to please take this patch
via your arch tree - to avoid any merge-hassles and other interdependencies
later.

P.S. I've deliberately NOT added the new items at the end of arch/*/Kconfig,
to avoid any merge conflicts going further - anyhow both the ia64/parisc
Kconfigs are not sorted either.

Thx,
-Vineet


Vineet Gupta (1):
  sysctl: Enable PARISC "unaligned-trap" to be used cross-arch

 arch/parisc/Kconfig |    1 +
 init/Kconfig        |    8 ++++++++
 kernel/sysctl.c     |    7 ++++++-
 3 files changed, 15 insertions(+), 1 deletions(-)

-- 
1.7.4.1

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

* [RESEND PATCH] sysctl: Enable PARISC "unaligned-trap" to be used cross-arch
  2013-01-03  6:59 ` [RESEND PATCH] Convert PARISC sysctl to be generic Vineet Gupta
@ 2013-01-03  6:59   ` Vineet Gupta
  2013-01-15 22:03     ` Helge Deller
  0 siblings, 1 reply; 4+ messages in thread
From: Vineet Gupta @ 2013-01-03  6:59 UTC (permalink / raw)
  To: James E.J. Bottomley, Helge Deller
  Cc: linux-kernel, linux-parisc, linux-arch, arnd, Vineet Gupta,
	Eric W. Biederman, Serge Hallyn

PARISC defines /proc/sys/kernel/unaligned-trap to runtime toggle
unaligned access emulation.

The exact mechanics of enablig/disabling are still arch specific, we can
make the sysctl usable by other arches.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
---
 arch/parisc/Kconfig |    1 +
 init/Kconfig        |    8 ++++++++
 kernel/sysctl.c     |    7 ++++++-
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index b77feff..8c76095 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -20,6 +20,7 @@ config PARISC
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select GENERIC_SMP_IDLE_THREAD
 	select GENERIC_STRNCPY_FROM_USER
+	select SYSCTL_ARCH_UNALIGN_ALLOW
 	select HAVE_MOD_ARCH_SPECIFIC
 	select MODULES_USE_ELF_RELA
 	select CLONE_BACKWARDS
diff --git a/init/Kconfig b/init/Kconfig
index e188f9f..e64bb18 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1240,6 +1240,14 @@ config SYSCTL_ARCH_UNALIGN_NO_WARN
 	  unaligned access emulation going on under the hood.
 	  see arch/ia64/kernel/unaligned.c for reference
 
+config SYSCTL_ARCH_UNALIGN_ALLOW
+	bool
+	help
+	  Enable support for /proc/sys/kernel/unaligned-trap
+	  Allows arches to define/use @unaligned_enabled to runtime toggle
+	  the unaligned access emulation.
+	  see arch/parisc/kernel/unaligned.c for reference
+
 config KALLSYMS
 	 bool "Load all symbols for debugging/ksymoops" if EXPERT
 	 default y
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 840fd5e..c4cd655 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -157,13 +157,16 @@ extern int sysctl_tsb_ratio;
 
 #ifdef __hppa__
 extern int pwrsw_enabled;
-extern int unaligned_enabled;
 #endif
 
 #ifdef CONFIG_IA64
 extern int unaligned_dump_stack;
 #endif
 
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
+extern int unaligned_enabled;
+#endif
+
 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
 extern int no_unaligned_warning;
 #endif
@@ -548,6 +551,8 @@ static struct ctl_table kern_table[] = {
 	 	.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
+#endif
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
 	{
 		.procname	= "unaligned-trap",
 		.data		= &unaligned_enabled,
-- 
1.7.4.1

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

* Re: [RESEND PATCH] sysctl: Enable PARISC "unaligned-trap" to be used cross-arch
  2013-01-03  6:59   ` [RESEND PATCH] sysctl: Enable PARISC "unaligned-trap" to be used cross-arch Vineet Gupta
@ 2013-01-15 22:03     ` Helge Deller
  0 siblings, 0 replies; 4+ messages in thread
From: Helge Deller @ 2013-01-15 22:03 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: James E.J. Bottomley, linux-kernel, linux-parisc, linux-arch,
	arnd, Eric W. Biederman, Serge Hallyn

On 01/03/2013 07:59 AM, Vineet Gupta wrote:
> PARISC defines /proc/sys/kernel/unaligned-trap to runtime toggle
> unaligned access emulation.
>
> The exact mechanics of enablig/disabling are still arch specific, we can
> make the sysctl usable by other arches.
>
> Signed-off-by: Vineet Gupta<vgupta@synopsys.com>
> Cc: "James E.J. Bottomley"<jejb@parisc-linux.org>
> Cc: Helge Deller<deller@gmx.de>
> Cc: "Eric W. Biederman"<ebiederm@xmission.com>
> Cc: Serge Hallyn<serge.hallyn@canonical.com>

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

Vineet, as discussed, please push it through the ARC architecture tree...

Helge

> ---
>   arch/parisc/Kconfig |    1 +
>   init/Kconfig        |    8 ++++++++
>   kernel/sysctl.c     |    7 ++++++-
>   3 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
> index b77feff..8c76095 100644
> --- a/arch/parisc/Kconfig
> +++ b/arch/parisc/Kconfig
> @@ -20,6 +20,7 @@ config PARISC
>   	select ARCH_HAVE_NMI_SAFE_CMPXCHG
>   	select GENERIC_SMP_IDLE_THREAD
>   	select GENERIC_STRNCPY_FROM_USER
> +	select SYSCTL_ARCH_UNALIGN_ALLOW
>   	select HAVE_MOD_ARCH_SPECIFIC
>   	select MODULES_USE_ELF_RELA
>   	select CLONE_BACKWARDS
> diff --git a/init/Kconfig b/init/Kconfig
> index e188f9f..e64bb18 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1240,6 +1240,14 @@ config SYSCTL_ARCH_UNALIGN_NO_WARN
>   	  unaligned access emulation going on under the hood.
>   	  see arch/ia64/kernel/unaligned.c for reference
>
> +config SYSCTL_ARCH_UNALIGN_ALLOW
> +	bool
> +	help
> +	  Enable support for /proc/sys/kernel/unaligned-trap
> +	  Allows arches to define/use @unaligned_enabled to runtime toggle
> +	  the unaligned access emulation.
> +	  see arch/parisc/kernel/unaligned.c for reference
> +
>   config KALLSYMS
>   	 bool "Load all symbols for debugging/ksymoops" if EXPERT
>   	 default y
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 840fd5e..c4cd655 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -157,13 +157,16 @@ extern int sysctl_tsb_ratio;
>
>   #ifdef __hppa__
>   extern int pwrsw_enabled;
> -extern int unaligned_enabled;
>   #endif
>
>   #ifdef CONFIG_IA64
>   extern int unaligned_dump_stack;
>   #endif
>
> +#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
> +extern int unaligned_enabled;
> +#endif
> +
>   #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
>   extern int no_unaligned_warning;
>   #endif
> @@ -548,6 +551,8 @@ static struct ctl_table kern_table[] = {
>   	 	.mode		= 0644,
>   		.proc_handler	= proc_dointvec,
>   	},
> +#endif
> +#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
>   	{
>   		.procname	= "unaligned-trap",
>   		.data		=&unaligned_enabled,


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

end of thread, other threads:[~2013-01-15 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <50D2B75A.3000208@synopsys.com>
     [not found] ` <1356001898-2960-1-git-send-email-vgupta@synopsys.com>
2012-12-20 11:11   ` [PATCH] sysctl: convert arch specific unaligned access regulators to generic ones Vineet.Gupta1
2013-01-03  6:59 ` [RESEND PATCH] Convert PARISC sysctl to be generic Vineet Gupta
2013-01-03  6:59   ` [RESEND PATCH] sysctl: Enable PARISC "unaligned-trap" to be used cross-arch Vineet Gupta
2013-01-15 22:03     ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox