aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-18 04:42:24 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 12:46:05 -0500
commitbf14e3b979a01cd7298d631736f965fe83c6e2bc (patch)
tree8440a0641556332763615edc881f81d1da6f2d37
parent4d86dfbbda09b3c67bcaeb370f22a2cc7f39205b (diff)
sysctl: Enable PARISC "unaligned-trap" to be used cross-arch
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> Acked-by: Helge Deller <deller@gmx.de> 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>
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--init/Kconfig8
-rw-r--r--kernel/sysctl.c5
3 files changed, 14 insertions, 0 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index b77feffbadea..8c7609539717 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -20,6 +20,7 @@ config PARISC
20 select ARCH_HAVE_NMI_SAFE_CMPXCHG 20 select ARCH_HAVE_NMI_SAFE_CMPXCHG
21 select GENERIC_SMP_IDLE_THREAD 21 select GENERIC_SMP_IDLE_THREAD
22 select GENERIC_STRNCPY_FROM_USER 22 select GENERIC_STRNCPY_FROM_USER
23 select SYSCTL_ARCH_UNALIGN_ALLOW
23 select HAVE_MOD_ARCH_SPECIFIC 24 select HAVE_MOD_ARCH_SPECIFIC
24 select MODULES_USE_ELF_RELA 25 select MODULES_USE_ELF_RELA
25 select CLONE_BACKWARDS 26 select CLONE_BACKWARDS
diff --git a/init/Kconfig b/init/Kconfig
index be8b7f55312d..01180da49add 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1232,6 +1232,14 @@ config SYSCTL_EXCEPTION_TRACE
1232 help 1232 help
1233 Enable support for /proc/sys/debug/exception-trace. 1233 Enable support for /proc/sys/debug/exception-trace.
1234 1234
1235config SYSCTL_ARCH_UNALIGN_ALLOW
1236 bool
1237 help
1238 Enable support for /proc/sys/kernel/unaligned-trap
1239 Allows arches to define/use @unaligned_enabled to runtime toggle
1240 the unaligned access emulation.
1241 see arch/parisc/kernel/unaligned.c for reference
1242
1235config KALLSYMS 1243config KALLSYMS
1236 bool "Load all symbols for debugging/ksymoops" if EXPERT 1244 bool "Load all symbols for debugging/ksymoops" if EXPERT
1237 default y 1245 default y
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index c88878db491e..878b4c41cfb7 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -157,6 +157,9 @@ extern int sysctl_tsb_ratio;
157 157
158#ifdef __hppa__ 158#ifdef __hppa__
159extern int pwrsw_enabled; 159extern int pwrsw_enabled;
160#endif
161
162#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
160extern int unaligned_enabled; 163extern int unaligned_enabled;
161#endif 164#endif
162 165
@@ -545,6 +548,8 @@ static struct ctl_table kern_table[] = {
545 .mode = 0644, 548 .mode = 0644,
546 .proc_handler = proc_dointvec, 549 .proc_handler = proc_dointvec,
547 }, 550 },
551#endif
552#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
548 { 553 {
549 .procname = "unaligned-trap", 554 .procname = "unaligned-trap",
550 .data = &unaligned_enabled, 555 .data = &unaligned_enabled,