* [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:23 ` Vineet.Gupta1 0 siblings, 0 replies; 9+ messages in thread From: Vineet.Gupta1 @ 2012-12-20 11:23 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] 9+ messages in thread
* [RESEND PATCH] Convert IA64 sysctl to 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 IA64 "ignore-unaligned-usertrap" to be used cross-arch Vineet Gupta 1 sibling, 1 reply; 9+ messages in thread From: Vineet Gupta @ 2013-01-03 6:59 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: linux-kernel, linux-ia64, 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 IA64 "ignore-unaligned-usertrap" to be used cross-arch arch/ia64/Kconfig | 1 + init/Kconfig | 8 ++++++++ kernel/sysctl.c | 9 +++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) -- 1.7.4.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [RESEND PATCH] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-03 6:59 ` [RESEND PATCH] Convert IA64 sysctl to generic Vineet Gupta @ 2013-01-03 6:59 ` Vineet Gupta 2013-01-08 23:43 ` Tony Luck 0 siblings, 1 reply; 9+ messages in thread From: Vineet Gupta @ 2013-01-03 6:59 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: linux-kernel, linux-ia64, linux-arch, arnd, Vineet Gupta, Eric W. Biederman, Serge Hallyn IA64 defines /proc/sys/kernel/ignore-unaligned-usertrap to control verbosw warnings on unaligned access emaultion. While the exact menchaincs (ignore/shout) are still arch specific, we can make the sysctl usable by other arches. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Serge Hallyn <serge.hallyn@canonical.com> --- arch/ia64/Kconfig | 1 + init/Kconfig | 8 ++++++++ kernel/sysctl.c | 9 +++++++-- 3 files changed, 16 insertions(+), 2 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/init/Kconfig b/init/Kconfig index 7d30240..e188f9f 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1232,6 +1232,14 @@ 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 KALLSYMS bool "Load all symbols for debugging/ksymoops" if EXPERT default y diff --git a/kernel/sysctl.c b/kernel/sysctl.c index c88878d..840fd5e 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -161,10 +161,13 @@ extern int unaligned_enabled; #endif #ifdef CONFIG_IA64 -extern int no_unaligned_warning; extern int unaligned_dump_stack; #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); @@ -911,7 +914,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, @@ -919,6 +922,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] 9+ messages in thread
* Re: [RESEND PATCH] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-03 6:59 ` [RESEND PATCH] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch Vineet Gupta @ 2013-01-08 23:43 ` Tony Luck 2013-01-09 14:26 ` Vineet Gupta 0 siblings, 1 reply; 9+ messages in thread From: Tony Luck @ 2013-01-08 23:43 UTC (permalink / raw) To: Vineet Gupta Cc: Fenghua Yu, linux-kernel, linux-ia64, linux-arch, arnd, Eric W. Biederman, Serge Hallyn On Wed, Jan 2, 2013 at 10:47 PM, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote: > verbosw warnings on unaligned access emaultion. "verbose", "emulation" > While the exact menchaincs (ignore/shout) are still arch specific, we "mechanics" > +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 "possibly" > + unaligned access emulation going on under the hood. > + see arch/ia64/kernel/unaligned.c for reference It doesn't seem right to point users at an ia64 specific file now that you are making this available to all arches. -Tony ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RESEND PATCH] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-08 23:43 ` Tony Luck @ 2013-01-09 14:26 ` Vineet Gupta 2013-01-09 14:48 ` [PATCH v2] " Vineet Gupta 0 siblings, 1 reply; 9+ messages in thread From: Vineet Gupta @ 2013-01-09 14:26 UTC (permalink / raw) To: Tony Luck Cc: Fenghua Yu, linux-kernel, linux-ia64, linux-arch, arnd, Eric W. Biederman, Serge Hallyn On Wednesday 09 January 2013 05:13 AM, Tony Luck wrote: > On Wed, Jan 2, 2013 at 10:47 PM, Vineet Gupta > <Vineet.Gupta1@synopsys.com> wrote: > > >> +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 > "possibly" >> + unaligned access emulation going on under the hood. >> + see arch/ia64/kernel/unaligned.c for reference > It doesn't seem right to point users at an ia64 specific file now > that you are making this available to all arches. The ia64 "reference" is for how the sysctl knob is used - since all we are doing is moving just the sysctl out of #ifdef ARCH_XYZ. At any rate, I've removed the line from help. Revised patch to follow. And as initially requested this will need to go thru IA64-next tree to avoid any merge dependencies. TIA, -Vineet ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-09 14:26 ` Vineet Gupta @ 2013-01-09 14:48 ` Vineet Gupta 2013-01-09 18:55 ` Tony Luck 0 siblings, 1 reply; 9+ messages in thread From: Vineet Gupta @ 2013-01-09 14:48 UTC (permalink / raw) To: tony.luck Cc: Vineet Gupta, Fenghua Yu, Eric W. Biederman, Serge Hallyn, linux-ia64, linux-kernel, linux-arch IA64 defines /proc/sys/kernel/ignore-unaligned-usertrap to control verbose warnings on unaligned access emulation. The exact mechanics of what to do with sysctl (ignore/shout) are arch specific, this change enables the sysctl to be usable cross-arch. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Serge Hallyn <serge.hallyn@canonical.com> Cc: linux-ia64@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org --- arch/ia64/Kconfig | 1 + init/Kconfig | 7 +++++++ kernel/sysctl.c | 9 +++++++-- 3 files changed, 15 insertions(+), 2 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/init/Kconfig b/init/Kconfig index 7d30240..523bee1 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1232,6 +1232,13 @@ 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 possibly warn + about unaligned access emulation going on under the hood. + config KALLSYMS bool "Load all symbols for debugging/ksymoops" if EXPERT default y diff --git a/kernel/sysctl.c b/kernel/sysctl.c index c88878d..840fd5e 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -161,10 +161,13 @@ extern int unaligned_enabled; #endif #ifdef CONFIG_IA64 -extern int no_unaligned_warning; extern int unaligned_dump_stack; #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); @@ -911,7 +914,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, @@ -919,6 +922,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] 9+ messages in thread
* Re: [PATCH v2] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-09 14:48 ` [PATCH v2] " Vineet Gupta @ 2013-01-09 18:55 ` Tony Luck 2013-01-09 21:03 ` Eric W. Biederman 2013-01-10 4:25 ` Vineet Gupta 0 siblings, 2 replies; 9+ messages in thread From: Tony Luck @ 2013-01-09 18:55 UTC (permalink / raw) To: Vineet Gupta Cc: Fenghua Yu, Eric W. Biederman, Serge Hallyn, linux-ia64, linux-kernel, linux-arch Ok. Queued for 3.9 merge window. It should show up in linux-next in the next day or two. We'll see if anyone complains about the name SYSCTL_ARCH_UNALIGN_NO_WARN (every time I touch the Kconfig bits it seems that there is some other, better way that we do this now). -Tony ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-09 18:55 ` Tony Luck @ 2013-01-09 21:03 ` Eric W. Biederman 2013-01-10 4:25 ` Vineet Gupta 1 sibling, 0 replies; 9+ messages in thread From: Eric W. Biederman @ 2013-01-09 21:03 UTC (permalink / raw) To: Tony Luck Cc: Vineet Gupta, Fenghua Yu, Serge Hallyn, linux-ia64, linux-kernel, linux-arch Tony Luck <tony.luck@gmail.com> writes: > Ok. Queued for 3.9 merge window. It should show up in linux-next in > the next day or two. We'll see if anyone complains about the name > SYSCTL_ARCH_UNALIGN_NO_WARN (every time I touch the Kconfig > bits it seems that there is some other, better way that we do this > now). The other semi-sane way I could see to do this would be to break the code out of kernel/sysctl.c into it's own sysctl table and have the arches that want this sysctl just register it themselves. Shrug. It probably isn't worth the effor right now. Eric ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch 2013-01-09 18:55 ` Tony Luck 2013-01-09 21:03 ` Eric W. Biederman @ 2013-01-10 4:25 ` Vineet Gupta 1 sibling, 0 replies; 9+ messages in thread From: Vineet Gupta @ 2013-01-10 4:25 UTC (permalink / raw) To: Tony Luck Cc: Fenghua Yu, Eric W. Biederman, Serge Hallyn, linux-ia64, linux-kernel, linux-arch On Thursday 10 January 2013 12:25 AM, Tony Luck wrote: > Ok. Queued for 3.9 merge window. It should show up in linux-next in > the next day or two. We'll see if anyone complains about the name > SYSCTL_ARCH_UNALIGN_NO_WARN (every time I touch the Kconfig > bits it seems that there is some other, better way that we do this now). > > -Tony Thanks a bunch. -Vineet ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-01-10 4:25 UTC | newest]
Thread overview: 9+ 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:23 ` [PATCH] sysctl: convert arch specific unaligned access regulators to generic ones Vineet.Gupta1
2013-01-03 6:59 ` [RESEND PATCH] Convert IA64 sysctl to generic Vineet Gupta
2013-01-03 6:59 ` [RESEND PATCH] sysctl: Enable IA64 "ignore-unaligned-usertrap" to be used cross-arch Vineet Gupta
2013-01-08 23:43 ` Tony Luck
2013-01-09 14:26 ` Vineet Gupta
2013-01-09 14:48 ` [PATCH v2] " Vineet Gupta
2013-01-09 18:55 ` Tony Luck
2013-01-09 21:03 ` Eric W. Biederman
2013-01-10 4:25 ` Vineet Gupta
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox