* [PATCH] arm64: traps: Add str of description to panic() in die()
@ 2020-08-04 8:53 Yue Hu
2020-09-07 16:05 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Yue Hu @ 2020-08-04 8:53 UTC (permalink / raw)
To: catalin.marinas, will, james.morse, Dave.Martin
Cc: linux-arm-kernel, linux-kernel, huyue2, zbestahu
From: Yue Hu <huyue2@yulong.com>
Currently, there are different description strings in die() such as
die("Oops",,), die("Oops - BUG",,). And panic() called by die() will
always show "Fatal exception" or "Fatal exception in interrupt".
Note that panic() will run any panic handler via panic_notifier_list.
And the string above will be formatted and placed in static buf[]
which will be passed to handler.
So panic handler can not distinguish which Oops it is from the buf if
we want to do some things like reserve the string in memory or panic
statistics. It's not benefit to debug. We need to add more codes to
troubleshoot. Let's utilize existing resource to make debug much simpler.
Signed-off-by: Yue Hu <huyue2@yulong.com>
---
arch/arm64/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 47f651d..5582d3e 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -200,9 +200,9 @@ void die(const char *str, struct pt_regs *regs, int err)
oops_exit();
if (in_interrupt())
- panic("Fatal exception in interrupt");
+ panic("%s: Fatal exception in interrupt", str);
if (panic_on_oops)
- panic("Fatal exception");
+ panic("%s: Fatal exception", str);
raw_spin_unlock_irqrestore(&die_lock, flags);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: traps: Add str of description to panic() in die()
2020-08-04 8:53 [PATCH] arm64: traps: Add str of description to panic() in die() Yue Hu
@ 2020-09-07 16:05 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2020-09-07 16:05 UTC (permalink / raw)
To: james.morse, Yue Hu, Dave.Martin, catalin.marinas
Cc: kernel-team, Will Deacon, linux-kernel, huyue2, zbestahu,
linux-arm-kernel
On Tue, 4 Aug 2020 16:53:47 +0800, Yue Hu wrote:
> Currently, there are different description strings in die() such as
> die("Oops",,), die("Oops - BUG",,). And panic() called by die() will
> always show "Fatal exception" or "Fatal exception in interrupt".
>
> Note that panic() will run any panic handler via panic_notifier_list.
> And the string above will be formatted and placed in static buf[]
> which will be passed to handler.
>
> [...]
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64: traps: Add str of description to panic() in die()
https://git.kernel.org/arm64/c/b4c971245925
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-07 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 8:53 [PATCH] arm64: traps: Add str of description to panic() in die() Yue Hu
2020-09-07 16:05 ` 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).