* [PATCH 1/2] arm64: Call __show_regs directly @ 2017-05-08 13:56 Kefeng Wang 2017-05-08 13:56 ` [PATCH 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang 2017-05-08 14:55 ` [PATCH 1/2] arm64: Call __show_regs directly Mark Rutland 0 siblings, 2 replies; 9+ messages in thread From: Kefeng Wang @ 2017-05-08 13:56 UTC (permalink / raw) To: linux-arm-kernel Call __show_regs directly in longjmp_break_handler() and __do_user_fault(), it is to prepare for dump stack when softlockup detected. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- arch/arm64/kernel/probes/kprobes.c | 4 ++-- arch/arm64/mm/fault.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index c5c4594..d849d98 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -522,9 +522,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) pr_err("current sp %lx does not match saved sp %lx\n", orig_sp, stack_addr); pr_err("Saved registers for jprobe %p\n", jp); - show_regs(saved_regs); + __show_regs(saved_regs); pr_err("Current registers\n"); - show_regs(regs); + __show_regs(regs); BUG(); } unpause_graph_tracing(); diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 37b95df..c3f2b10 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -250,7 +250,7 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, tsk->comm, task_pid_nr(tsk), inf->name, sig, addr, esr); show_pte(tsk->mm, addr); - show_regs(regs); + __show_regs(regs); } tsk->thread.fault_address = addr; -- 1.7.12.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] arm64: Add dump_backtrace() in show_regs 2017-05-08 13:56 [PATCH 1/2] arm64: Call __show_regs directly Kefeng Wang @ 2017-05-08 13:56 ` Kefeng Wang 2017-05-08 15:04 ` Mark Rutland 2017-05-08 14:55 ` [PATCH 1/2] arm64: Call __show_regs directly Mark Rutland 1 sibling, 1 reply; 9+ messages in thread From: Kefeng Wang @ 2017-05-08 13:56 UTC (permalink / raw) To: linux-arm-kernel When the system trigger a softlockup(eg, infinite loop when PREEMPT_NONE), it only shows regs without stack trace, which makes it difficult to adress the issue. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- arch/arm64/include/asm/stacktrace.h | 1 + arch/arm64/kernel/process.c | 1 + arch/arm64/kernel/traps.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h index 801a16db..5b6eafc 100644 --- a/arch/arm64/include/asm/stacktrace.h +++ b/arch/arm64/include/asm/stacktrace.h @@ -30,5 +30,6 @@ struct stackframe { extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, int (*fn)(struct stackframe *, void *), void *data); +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk); #endif /* __ASM_STACKTRACE_H */ diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index ae2a835..af1ea25 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -210,6 +210,7 @@ void __show_regs(struct pt_regs *regs) void show_regs(struct pt_regs * regs) { __show_regs(regs); + dump_backtrace(regs, NULL); } static void tls_thread_flush(void) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index d4d6ae0..368c3c8 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -140,7 +140,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) } } -static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) +void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) { struct stackframe frame; unsigned long irq_stack_ptr; -- 1.7.12.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] arm64: Add dump_backtrace() in show_regs 2017-05-08 13:56 ` [PATCH 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang @ 2017-05-08 15:04 ` Mark Rutland 2017-05-09 1:23 ` Kefeng Wang 0 siblings, 1 reply; 9+ messages in thread From: Mark Rutland @ 2017-05-08 15:04 UTC (permalink / raw) To: linux-arm-kernel On Mon, May 08, 2017 at 09:56:55PM +0800, Kefeng Wang wrote: > When the system trigger a softlockup(eg, infinite loop when > PREEMPT_NONE), it only shows regs without stack trace, which > makes it difficult to adress the issue. How about: Generic code expects show_regs() to dump the stack, but arm64's show_regs() does not. This makes it hard to debug softlockups and other issues that reesult in show_regs() being called. This patch updates arm64's show_regs() to dump the stack, as common code expects. > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> > --- > arch/arm64/include/asm/stacktrace.h | 1 + > arch/arm64/kernel/process.c | 1 + > arch/arm64/kernel/traps.c | 2 +- > 3 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h > index 801a16db..5b6eafc 100644 > --- a/arch/arm64/include/asm/stacktrace.h > +++ b/arch/arm64/include/asm/stacktrace.h > @@ -30,5 +30,6 @@ struct stackframe { > extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); > extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, > int (*fn)(struct stackframe *, void *), void *data); > +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk); > > #endif /* __ASM_STACKTRACE_H */ > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > index ae2a835..af1ea25 100644 > --- a/arch/arm64/kernel/process.c > +++ b/arch/arm64/kernel/process.c > @@ -210,6 +210,7 @@ void __show_regs(struct pt_regs *regs) > void show_regs(struct pt_regs * regs) > { > __show_regs(regs); > + dump_backtrace(regs, NULL); > } I believe that as we pass the regs down, this should trigger the frame skipping that we want, as I mentioned in reply to v1 [1]. So FWIW, with the commit message fixup: Acked-by: Mark Rutland <mark.rutland@arm.com> Thanks, Mark. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-March/496377.html > static void tls_thread_flush(void) > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index d4d6ae0..368c3c8 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -140,7 +140,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) > } > } > > -static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) > +void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) > { > struct stackframe frame; > unsigned long irq_stack_ptr; > -- > 1.7.12.4 > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] arm64: Add dump_backtrace() in show_regs 2017-05-08 15:04 ` Mark Rutland @ 2017-05-09 1:23 ` Kefeng Wang 0 siblings, 0 replies; 9+ messages in thread From: Kefeng Wang @ 2017-05-09 1:23 UTC (permalink / raw) To: linux-arm-kernel On 2017/5/8 23:04, Mark Rutland wrote: > On Mon, May 08, 2017 at 09:56:55PM +0800, Kefeng Wang wrote: >> When the system trigger a softlockup(eg, infinite loop when >> PREEMPT_NONE), it only shows regs without stack trace, which >> makes it difficult to adress the issue. > > How about: > > Generic code expects show_regs() to dump the stack, but arm64's > show_regs() does not. This makes it hard to debug softlockups and > other issues that reesult in show_regs() being called. > > This patch updates arm64's show_regs() to dump the stack, as common > code expects. > Will update, thanks. >> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> >> --- >> arch/arm64/include/asm/stacktrace.h | 1 + >> arch/arm64/kernel/process.c | 1 + >> arch/arm64/kernel/traps.c | 2 +- >> 3 files changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h >> index 801a16db..5b6eafc 100644 >> --- a/arch/arm64/include/asm/stacktrace.h >> +++ b/arch/arm64/include/asm/stacktrace.h >> @@ -30,5 +30,6 @@ struct stackframe { >> extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); >> extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, >> int (*fn)(struct stackframe *, void *), void *data); >> +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk); >> >> #endif /* __ASM_STACKTRACE_H */ >> diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c >> index ae2a835..af1ea25 100644 >> --- a/arch/arm64/kernel/process.c >> +++ b/arch/arm64/kernel/process.c >> @@ -210,6 +210,7 @@ void __show_regs(struct pt_regs *regs) >> void show_regs(struct pt_regs * regs) >> { >> __show_regs(regs); >> + dump_backtrace(regs, NULL); >> } > > I believe that as we pass the regs down, this should trigger the frame > skipping that we want, as I mentioned in reply to v1 [1]. > > So FWIW, with the commit message fixup: > > Acked-by: Mark Rutland <mark.rutland@arm.com> Thanks for your careful guidance, will update both. Kefeng > > Thanks, > Mark. > > [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-March/496377.html > >> static void tls_thread_flush(void) >> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c >> index d4d6ae0..368c3c8 100644 >> --- a/arch/arm64/kernel/traps.c >> +++ b/arch/arm64/kernel/traps.c >> @@ -140,7 +140,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) >> } >> } >> >> -static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) >> +void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) >> { >> struct stackframe frame; >> unsigned long irq_stack_ptr; >> -- >> 1.7.12.4 >> > > . > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] arm64: Call __show_regs directly 2017-05-08 13:56 [PATCH 1/2] arm64: Call __show_regs directly Kefeng Wang 2017-05-08 13:56 ` [PATCH 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang @ 2017-05-08 14:55 ` Mark Rutland 2017-05-09 1:53 ` [PATCH v2 " Kefeng Wang 1 sibling, 1 reply; 9+ messages in thread From: Mark Rutland @ 2017-05-08 14:55 UTC (permalink / raw) To: linux-arm-kernel Hi, I see these patches are effectively a v2 of [1]. Please cite prior patch series when posting updates. The context really helps review. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-March/494840.html On Mon, May 08, 2017 at 09:56:54PM +0800, Kefeng Wang wrote: > Call __show_regs directly in longjmp_break_handler() and > __do_user_fault(), it is to prepare for dump stack when > softlockup detected. > > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> The above doesn't explain the problem clearly. How about: Generic code expects show_regs() to also dump the stack, but arm64's show_reg() does not do this. Some arm64 callers of show_regs() *only* want the registers dumped, without the stack. To enable generic code to work as expected, we need to make show_regs() dump the stack. Where we only want the registers dumped, we must use __show_regs(). This patch updates code to use __show_regs() where only registers are desired. A subsequent patch will modify show_regs(). ... with that: Acked-by: Mark Rutland <mark.rutland@arm.com> Thanks, Mark. > --- > arch/arm64/kernel/probes/kprobes.c | 4 ++-- > arch/arm64/mm/fault.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c > index c5c4594..d849d98 100644 > --- a/arch/arm64/kernel/probes/kprobes.c > +++ b/arch/arm64/kernel/probes/kprobes.c > @@ -522,9 +522,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) > pr_err("current sp %lx does not match saved sp %lx\n", > orig_sp, stack_addr); > pr_err("Saved registers for jprobe %p\n", jp); > - show_regs(saved_regs); > + __show_regs(saved_regs); > pr_err("Current registers\n"); > - show_regs(regs); > + __show_regs(regs); > BUG(); > } > unpause_graph_tracing(); > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c > index 37b95df..c3f2b10 100644 > --- a/arch/arm64/mm/fault.c > +++ b/arch/arm64/mm/fault.c > @@ -250,7 +250,7 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, > tsk->comm, task_pid_nr(tsk), inf->name, sig, > addr, esr); > show_pte(tsk->mm, addr); > - show_regs(regs); > + __show_regs(regs); > } > > tsk->thread.fault_address = addr; > -- > 1.7.12.4 > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] arm64: Call __show_regs directly 2017-05-08 14:55 ` [PATCH 1/2] arm64: Call __show_regs directly Mark Rutland @ 2017-05-09 1:53 ` Kefeng Wang 2017-05-09 1:53 ` [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang 0 siblings, 1 reply; 9+ messages in thread From: Kefeng Wang @ 2017-05-09 1:53 UTC (permalink / raw) To: linux-arm-kernel Generic code expects show_regs() to also dump the stack, but arm64's show_reg() does not do this. Some arm64 callers of show_regs() *only* want the registers dumped, without the stack. To enable generic code to work as expected, we need to make show_regs() dump the stack. Where we only want the registers dumped, we must use __show_regs(). This patch updates code to use __show_regs() where only registers are desired. A subsequent patch will modify show_regs(). Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- v1->v2: - Update the changelog according to Mark's kindly review, thanks Mark again. Please see the background from link [1]. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-March/494840.html arch/arm64/kernel/probes/kprobes.c | 4 ++-- arch/arm64/mm/fault.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index c5c4594..d849d98 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -522,9 +522,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) pr_err("current sp %lx does not match saved sp %lx\n", orig_sp, stack_addr); pr_err("Saved registers for jprobe %p\n", jp); - show_regs(saved_regs); + __show_regs(saved_regs); pr_err("Current registers\n"); - show_regs(regs); + __show_regs(regs); BUG(); } unpause_graph_tracing(); diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 37b95df..c3f2b10 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -250,7 +250,7 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, tsk->comm, task_pid_nr(tsk), inf->name, sig, addr, esr); show_pte(tsk->mm, addr); - show_regs(regs); + __show_regs(regs); } tsk->thread.fault_address = addr; -- 1.7.12.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs 2017-05-09 1:53 ` [PATCH v2 " Kefeng Wang @ 2017-05-09 1:53 ` Kefeng Wang 2017-05-24 10:09 ` Mark Rutland 0 siblings, 1 reply; 9+ messages in thread From: Kefeng Wang @ 2017-05-09 1:53 UTC (permalink / raw) To: linux-arm-kernel Generic code expects show_regs() to dump the stack, but arm64's show_regs() does not. This makes it hard to debug softlockups and other issues that result in show_regs() being called. This patch updates arm64's show_regs() to dump the stack, as common code expects. Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- arch/arm64/include/asm/stacktrace.h | 1 + arch/arm64/kernel/process.c | 1 + arch/arm64/kernel/traps.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h index 801a16db..5b6eafc 100644 --- a/arch/arm64/include/asm/stacktrace.h +++ b/arch/arm64/include/asm/stacktrace.h @@ -30,5 +30,6 @@ struct stackframe { extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, int (*fn)(struct stackframe *, void *), void *data); +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk); #endif /* __ASM_STACKTRACE_H */ diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index ae2a835..af1ea25 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -210,6 +210,7 @@ void __show_regs(struct pt_regs *regs) void show_regs(struct pt_regs * regs) { __show_regs(regs); + dump_backtrace(regs, NULL); } static void tls_thread_flush(void) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index d4d6ae0..368c3c8 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -140,7 +140,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) } } -static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) +void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) { struct stackframe frame; unsigned long irq_stack_ptr; -- 1.7.12.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs 2017-05-09 1:53 ` [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang @ 2017-05-24 10:09 ` Mark Rutland 2017-05-25 10:58 ` Will Deacon 0 siblings, 1 reply; 9+ messages in thread From: Mark Rutland @ 2017-05-24 10:09 UTC (permalink / raw) To: linux-arm-kernel Hi, On Tue, May 09, 2017 at 09:53:37AM +0800, Kefeng Wang wrote: > Generic code expects show_regs() to dump the stack, but arm64's > show_regs() does not. This makes it hard to debug softlockups and > other issues that result in show_regs() being called. > > This patch updates arm64's show_regs() to dump the stack, as common > code expects. > > Acked-by: Mark Rutland <mark.rutland@arm.com> > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> > --- > arch/arm64/include/asm/stacktrace.h | 1 + > arch/arm64/kernel/process.c | 1 + > arch/arm64/kernel/traps.c | 2 +- > 3 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h > index 801a16db..5b6eafc 100644 > --- a/arch/arm64/include/asm/stacktrace.h > +++ b/arch/arm64/include/asm/stacktrace.h > @@ -30,5 +30,6 @@ struct stackframe { > extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); > extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, > int (*fn)(struct stackframe *, void *), void *data); > +extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk); > > #endif /* __ASM_STACKTRACE_H */ > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > index ae2a835..af1ea25 100644 > --- a/arch/arm64/kernel/process.c > +++ b/arch/arm64/kernel/process.c > @@ -210,6 +210,7 @@ void __show_regs(struct pt_regs *regs) > void show_regs(struct pt_regs * regs) > { > __show_regs(regs); > + dump_backtrace(regs, NULL); > } > > static void tls_thread_flush(void) > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index d4d6ae0..368c3c8 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -140,7 +140,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) > } > } > > -static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) > +void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) > { > struct stackframe frame; > unsigned long irq_stack_ptr; I just realised that we'll need one additional fixup: diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 0805b44..f452fcc 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -728,8 +728,6 @@ static int bug_handler(struct pt_regs *regs, unsigned int esr) break; case BUG_TRAP_TYPE_WARN: - /* Ideally, report_bug() should backtrace for us... but no. */ - dump_backtrace(regs, NULL); break; default: ... since report_bug() will call show_regs(), and dump the stack itself now. With that change, these patches will also fix *_ONCE() traps spewing backtraces every time they're invoked, which was a side-effect of commit: 19d436268dde9538 ("debug: Add _ONCE() logic to report_bug()") Would you mind folding that into a v3? Thanks, Mark. ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs 2017-05-24 10:09 ` Mark Rutland @ 2017-05-25 10:58 ` Will Deacon 0 siblings, 0 replies; 9+ messages in thread From: Will Deacon @ 2017-05-25 10:58 UTC (permalink / raw) To: linux-arm-kernel On Wed, May 24, 2017 at 11:09:49AM +0100, Mark Rutland wrote: > On Tue, May 09, 2017 at 09:53:37AM +0800, Kefeng Wang wrote: > > Generic code expects show_regs() to dump the stack, but arm64's > > show_regs() does not. This makes it hard to debug softlockups and > > other issues that result in show_regs() being called. > > > > This patch updates arm64's show_regs() to dump the stack, as common > > code expects. > > > > Acked-by: Mark Rutland <mark.rutland@arm.com> > > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> [...] > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index 0805b44..f452fcc 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -728,8 +728,6 @@ static int bug_handler(struct pt_regs *regs, unsigned int esr) > break; > > case BUG_TRAP_TYPE_WARN: > - /* Ideally, report_bug() should backtrace for us... but no. */ > - dump_backtrace(regs, NULL); > break; > > default: > > ... since report_bug() will call show_regs(), and dump the stack itself > now. > > With that change, these patches will also fix *_ONCE() traps spewing > backtraces every time they're invoked, which was a side-effect of > commit: > > 19d436268dde9538 ("debug: Add _ONCE() logic to report_bug()") > > Would you mind folding that into a v3? I've queued this locally, so I can just fold that in too. No need to repost. I'll push what I have at -rc3. Cheers, Will ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-05-25 10:58 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-05-08 13:56 [PATCH 1/2] arm64: Call __show_regs directly Kefeng Wang 2017-05-08 13:56 ` [PATCH 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang 2017-05-08 15:04 ` Mark Rutland 2017-05-09 1:23 ` Kefeng Wang 2017-05-08 14:55 ` [PATCH 1/2] arm64: Call __show_regs directly Mark Rutland 2017-05-09 1:53 ` [PATCH v2 " Kefeng Wang 2017-05-09 1:53 ` [PATCH v2 2/2] arm64: Add dump_backtrace() in show_regs Kefeng Wang 2017-05-24 10:09 ` Mark Rutland 2017-05-25 10:58 ` Will Deacon
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).