From: "qiwu.chen" <qiwuchen55@gmail.com>
To: corbet@lwn.net, oleg@redhat.com, catalin.marinas@arm.com,
will@kernel.org, paulmck@kernel.org, akpm@linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
"qiwu.chen" <qiwu.chen@transsion.com>
Subject: [PATCH v4 2/2] arm64: show signal info for global init
Date: Tue, 24 Sep 2024 15:43:41 +0800 [thread overview]
Message-ID: <20240924074341.37272-2-qiwu.chen@transsion.com> (raw)
In-Reply-To: <20240924074341.37272-1-qiwu.chen@transsion.com>
Currently, it's hard to debug panic issues caused by kill init
on arm64, since there is no debug info from user mode in current
panic msg such as the user_regs and maps info.
This patch shows signal info sent to the global init, which will
be helpful for debugging kill init issue caused by unhandled exception
from user mode.
- changes history:
v3:
https://lore.kernel.org/all/20240922095504.7182-1-qiwu.chen@transsion.com/
https://lore.kernel.org/all/20240922095504.7182-2-qiwu.chen@transsion.com/
v2: https://lore.kernel.org/all/20231110031553.33186-1-qiwu.chen@transsion.com/
v1: https://lore.kernel.org/all/20231110022720.GA3087@rlk/
Signed-off-by: qiwu.chen <qiwu.chen@transsion.com>
---
arch/arm64/kernel/traps.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 563cbce11126..3150fb84195f 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -247,12 +247,20 @@ static void arm64_show_signal(int signo, const char *str)
unsigned long esr = tsk->thread.fault_code;
struct pt_regs *regs = task_pt_regs(tsk);
+ /*
+ * The signal sent to the global init needs to be shown,
+ * which is useful for debugging kill init issue.
+ */
+ if (unlikely(is_global_init(tsk)))
+ goto dump;
+
/* Leave if the signal won't be shown */
if (!show_unhandled_signals ||
!unhandled_signal(tsk, signo) ||
!__ratelimit(&rs))
return;
+dump:
pr_info("%s[%d]: unhandled exception: ", tsk->comm, task_pid_nr(tsk));
if (esr)
pr_cont("%s, ESR 0x%016lx, ", esr_get_class_string(esr), esr);
--
2.25.1
next prev parent reply other threads:[~2024-09-24 7:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 7:43 [PATCH v4 1/2] panic: add option to dump task maps info in panic_print qiwu.chen
2024-09-24 7:43 ` qiwu.chen [this message]
2024-09-24 18:36 ` [PATCH v4 2/2] arm64: show signal info for global init Oleg Nesterov
2024-09-25 3:54 ` chenqiwu
2024-09-25 12:05 ` Oleg Nesterov
2024-09-26 10:12 ` chenqiwu
2024-09-24 11:33 ` [PATCH v4 1/2] panic: add option to dump task maps info in panic_print Oleg Nesterov
2024-09-25 8:27 ` chenqiwu
2024-09-25 12:19 ` Oleg Nesterov
2024-09-26 3:30 ` chenqiwu
2024-09-24 15:06 ` kernel test robot
2024-09-24 15:06 ` kernel test robot
2024-10-01 11:23 ` Lorenzo Stoakes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240924074341.37272-2-qiwu.chen@transsion.com \
--to=qiwuchen55@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=oleg@redhat.com \
--cc=paulmck@kernel.org \
--cc=qiwu.chen@transsion.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox