From: Wang Qing <wangqing@vivo.com>
To: Russell King <linux@armlinux.org.uk>,
Thomas Gleixner <tglx@linutronix.de>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Enrico Weigelt <info@metux.net>,
Allison Randal <allison@lohutok.net>,
Wang Qing <wangqing@vivo.com>,
Vincent Whitchurch <vincent.whitchurch@axis.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: [PATCH] arm: fixed backtrace when task running on another cpu
Date: Sat, 18 Apr 2020 19:14:18 +0800 [thread overview]
Message-ID: <1587208459-5470-1-git-send-email-wangqing@vivo.com> (raw)
We cannot get FP when the task is currently running on another CPU,
in this case, current stack is printed instead of the task.
Also, thread_saved_fp() is the last time the task was switched out,
we should not use too.
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
arch/arm/kernel/traps.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 1e70e72..24e860a 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -222,6 +222,9 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
} else if (tsk != current) {
fp = thread_saved_fp(tsk);
mode = 0x10;
+ } else if (task_curr(tsk))
+ pr_info("tsk is running on another CPU, not trace!\n");
+ fp = 0;
} else {
asm("mov %0, fp" : "=r" (fp) : : "cc");
mode = 0x10;
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
reply other threads:[~2020-04-18 11:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1587208459-5470-1-git-send-email-wangqing@vivo.com \
--to=wangqing@vivo.com \
--cc=allison@lohutok.net \
--cc=ebiederm@xmission.com \
--cc=info@metux.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=opensource.kernel@vivo.com \
--cc=tglx@linutronix.de \
--cc=vincent.whitchurch@axis.com \
/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;
as well as URLs for NNTP newsgroup(s).