* [PATCH] powerpc/xmon: Always enable xmon sysrq trigger
@ 2017-10-18 11:34 Guilherme G. Piccoli
2017-10-19 5:05 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Guilherme G. Piccoli @ 2017-10-18 11:34 UTC (permalink / raw)
To: linuxppc-dev; +Cc: gpiccoli, benh, paulus, mpe, brking
Distros vary the way they enable SysRq by default - mostly they seem
to enable some mask and then majority of the SysRq functions are
disabled. For instance, xmon does not even have a mask, and unsless
SysRq are completely enabled ( == 1), xmon trigger keeps disabled.
Countless times while investigating hangs we needed xmon and it was
disabled - machine just got hung and while in serial console, we just
couldn't drop to xmon, forcing to a new attempt to reproduce the issue
with SysRq fully enabled.
This patch "fixes" this by having xmon enabled in all possible masks
of SysRq. In other words, xmon trigger will only be disabled if SysRq
is 0 (completely disabled). So, while debugging a hung, when one tries
to drop to xmon this patch prevents the frustrating message:
"This sysrq operation is disabled".
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
---
Patch built and tested against powerpc/next.
arch/powerpc/xmon/xmon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 4679aeb84767..780d708472a2 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -3514,6 +3514,7 @@ static struct sysrq_key_op sysrq_xmon_op = {
.handler = sysrq_handle_xmon,
.help_msg = "xmon(x)",
.action_msg = "Entering xmon",
+ .enable_mask = 0xFFFF,
};
static int __init setup_xmon_sysrq(void)
--
2.14.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/xmon: Always enable xmon sysrq trigger
2017-10-18 11:34 [PATCH] powerpc/xmon: Always enable xmon sysrq trigger Guilherme G. Piccoli
@ 2017-10-19 5:05 ` Michael Ellerman
2017-10-19 11:06 ` Guilherme G. Piccoli
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-10-19 5:05 UTC (permalink / raw)
To: Guilherme G. Piccoli, linuxppc-dev; +Cc: gpiccoli, benh, paulus, brking
"Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com> writes:
> Distros vary the way they enable SysRq by default - mostly they seem
> to enable some mask and then majority of the SysRq functions are
> disabled. For instance, xmon does not even have a mask, and unsless
> SysRq are completely enabled ( == 1), xmon trigger keeps disabled.
>
> Countless times while investigating hangs we needed xmon and it was
> disabled - machine just got hung and while in serial console, we just
> couldn't drop to xmon, forcing to a new attempt to reproduce the issue
> with SysRq fully enabled.
>
> This patch "fixes" this by having xmon enabled in all possible masks
> of SysRq. In other words, xmon trigger will only be disabled if SysRq
> is 0 (completely disabled). So, while debugging a hung, when one tries
> to drop to xmon this patch prevents the frustrating message:
> "This sysrq operation is disabled".
I know it's annoying when you get stuck with a box like this, but I
can't merge this patch.
You're *removing* the system administrators ability to control access to
xmon (other than disabling sysrq entirely). That's a regression.
What we should do is get a bit allocated for xmon, so it can have a
non-zero single-bit enable mask.
cheers
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index 4679aeb84767..780d708472a2 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -3514,6 +3514,7 @@ static struct sysrq_key_op sysrq_xmon_op = {
> .handler = sysrq_handle_xmon,
> .help_msg = "xmon(x)",
> .action_msg = "Entering xmon",
> + .enable_mask = 0xFFFF,
> };
>
> static int __init setup_xmon_sysrq(void)
> --
> 2.14.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/xmon: Always enable xmon sysrq trigger
2017-10-19 5:05 ` Michael Ellerman
@ 2017-10-19 11:06 ` Guilherme G. Piccoli
0 siblings, 0 replies; 3+ messages in thread
From: Guilherme G. Piccoli @ 2017-10-19 11:06 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: brking, paulus
On 10/19/2017 03:05 AM, Michael Ellerman wrote:
> [...]
> I know it's annoying when you get stuck with a box like this, but I
> can't merge this patch.
>
> You're *removing* the system administrators ability to control access to
> xmon (other than disabling sysrq entirely). That's a regression.
>
> What we should do is get a bit allocated for xmon, so it can have a
> non-zero single-bit enable mask.
>
Agree with you, thanks for the enlightening comment. Let's then drop
this one, since sysrq=1 would do the job for us now anyway.
Cheers,
Guilherme
> cheers
>
>
>> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
>> index 4679aeb84767..780d708472a2 100644
>> --- a/arch/powerpc/xmon/xmon.c
>> +++ b/arch/powerpc/xmon/xmon.c
>> @@ -3514,6 +3514,7 @@ static struct sysrq_key_op sysrq_xmon_op = {
>> .handler = sysrq_handle_xmon,
>> .help_msg = "xmon(x)",
>> .action_msg = "Entering xmon",
>> + .enable_mask = 0xFFFF,
>> };
>>
>> static int __init setup_xmon_sysrq(void)
>> --
>> 2.14.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-19 11:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 11:34 [PATCH] powerpc/xmon: Always enable xmon sysrq trigger Guilherme G. Piccoli
2017-10-19 5:05 ` Michael Ellerman
2017-10-19 11:06 ` Guilherme G. Piccoli
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).