From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-08 12:14:56
Hi,
Couple of small things I've come across. After this, injecting nmi to
enter xmon (via qemu) and then recovering works nicely.
Thanks,
Nick
Nicholas Piggin (2):
powerpc: fix graceful debugger recovery
powerpc: fix second nested oops hang
arch/powerpc/kernel/traps.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
--
2.10.2
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-08 12:14:59
When exiting xmon with 'x' (exit and recover), oops_begin bails
out immediately, but die then calls __die() and oops_end(), which
cause a lot of bad things to happen.
If the debugger was attached then went to graceful recovery, exit
from die() immediately.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/traps.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-08 12:15:02
When ending an oops, don't clear die_owner unless the nest count
went to zero. This prevents a second nested oops from hanging forever
on the die_lock.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/traps.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-11-10 01:36:04
Nicholas Piggin [off-list ref] writes:
When exiting xmon with 'x' (exit and recover), oops_begin bails
out immediately, but die then calls __die() and oops_end(), which
cause a lot of bad things to happen.
In fact oops_begin() returns 1, which oops_end() then passes directly to
raw_local_irq_restore() as flags. On 64-bit that actually works because
arch_local_irq_restore() takes just "en" (enable), not real flags. But
on 32-bit it's supposed to be the MSR value. So that's impressively
broken.
If the debugger was attached then went to graceful recovery, exit
from die() immediately.
Right. Crucially it doesn't change anything in terms of the actual logic
of oops_begin(), ie. previously oops_begin() did nothing prior to
calling debugger(), and after this patch that remains the same (which
you did mention above but just spelling it out for myself).
cheers
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-10 04:25:09
On Thu, 10 Nov 2016 12:35:59 +1100
Michael Ellerman [off-list ref] wrote:
Nicholas Piggin [off-list ref] writes:
quoted
When exiting xmon with 'x' (exit and recover), oops_begin bails
out immediately, but die then calls __die() and oops_end(), which
cause a lot of bad things to happen.
In fact oops_begin() returns 1, which oops_end() then passes directly to
raw_local_irq_restore() as flags. On 64-bit that actually works because
arch_local_irq_restore() takes just "en" (enable), not real flags. But
on 32-bit it's supposed to be the MSR value. So that's impressively
broken.
Yeah, I guess most of the time you either go to debugger with
sysrq, or in case of a crash don't try to graceful recover.
When sending debug NMIs down via system reset it becomes a problem!
quoted
If the debugger was attached then went to graceful recovery, exit
from die() immediately.
Right. Crucially it doesn't change anything in terms of the actual logic
of oops_begin(), ie. previously oops_begin() did nothing prior to
calling debugger(), and after this patch that remains the same (which
you did mention above but just spelling it out for myself).
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-11-10 10:25:54
Nicholas Piggin [off-list ref] writes:
On Thu, 10 Nov 2016 12:35:59 +1100
Michael Ellerman [off-list ref] wrote:
quoted
Nicholas Piggin [off-list ref] writes:
quoted
When exiting xmon with 'x' (exit and recover), oops_begin bails
out immediately, but die then calls __die() and oops_end(), which
cause a lot of bad things to happen.
In fact oops_begin() returns 1, which oops_end() then passes directly to
raw_local_irq_restore() as flags. On 64-bit that actually works because
arch_local_irq_restore() takes just "en" (enable), not real flags. But
on 32-bit it's supposed to be the MSR value. So that's impressively
broken.
Yeah, I guess most of the time you either go to debugger with
sysrq, or in case of a crash don't try to graceful recover.
Yeah. It's debatable whether we should even allow graceful recovery, but
it's useful sometimes and regular users probably shouldn't have a
debugger enabled anyway.
cheers
From: Michael Ellerman <hidden> Date: 2016-11-22 00:34:15
On Tue, 2016-11-08 at 12:14:44 UTC, Nicholas Piggin wrote:
When exiting xmon with 'x' (exit and recover), oops_begin bails
out immediately, but die then calls __die() and oops_end(), which
cause a lot of bad things to happen.
If the debugger was attached then went to graceful recovery, exit
from die() immediately.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
From: Michael Ellerman <hidden> Date: 2016-11-22 00:34:16
On Tue, 2016-11-08 at 12:14:45 UTC, Nicholas Piggin wrote:
When ending an oops, don't clear die_owner unless the nest count
went to zero. This prevents a second nested oops from hanging forever
on the die_lock.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>