linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	<linux-arm-kernel@lists.infradead.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH] arm64: skip dump_backtrace() in show_regs when user mode pt_regs
Date: Thu, 28 Mar 2019 19:45:27 +0800	[thread overview]
Message-ID: <20190328114527.171178-1-wangkefeng.wang@huawei.com> (raw)

There is no need to call dump_backtrace() when the pt_regs
corresponds to user mode, eg,

[  334.634005] potentially unexpected fatal signal 11.
[  334.634476] CPU: 3 PID: 2049 Comm: test Not tainted 5.1.0-rc2 #24
[  334.634745] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
[  334.635786] pstate: 60001000 (nZCv daif -PAN -UAO)
[  334.636131] pc : 0000aaaaad4c0788
[  334.636725] lr : 0000ffff83aac6e0
[  334.637006] sp : 0000ffffd14e9670
[  334.637352] x29: 0000ffffd14e9690 x28: 0000000000000000
[  334.637814] x27: 0000000000000000 x26: 0000000000000000
[  334.638143] x25: 0000000000000000 x24: 0000000000000000
[  334.638460] x23: 0000000000000000 x22: 0000000000000000
[  334.639499] x21: 0000aaaaad4c0650 x20: 0000000000000000
[  334.640336] x19: 0000aaaaad4c0790 x18: 0000000000000002
[  334.641062] x17: 0000ffff83aac600 x16: 0000aaaaad4d0fa0
[  334.641474] x15: 0000ffff83c10150 x14: 0000ffff83c101e0
[  334.641894] x13: 0000ffff83c12048 x12: 0000000000000000
[  334.642421] x11: 0000000000010000 x10: 0000000008000000
[  334.642749] x9 : 000000000fffffff x8 : ffffffffffffffff
[  334.643378] x7 : 0000000000010000 x6 : 0000ffff83be0b00
[  334.643669] x5 : 0000000000000000 x4 : 0000000000000000
[  334.644012] x3 : 0000aaaaad4c0754 x2 : 0000ffffd14e97d8
[  334.644302] x1 : 0000fffefffffffc x0 : 0000ffff00000000
[  334.645211] Call trace:

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/arm64/kernel/process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 3767fb21a5b8..de224f1512ca 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -298,7 +298,8 @@ void __show_regs(struct pt_regs *regs)
 void show_regs(struct pt_regs * regs)
 {
 	__show_regs(regs);
-	dump_backtrace(regs, NULL);
+	if (!user_mode(regs))
+		dump_backtrace(regs, NULL);
 }
 
 static void tls_thread_flush(void)
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-03-28 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 11:45 Kefeng Wang [this message]
2019-04-03 12:44 ` [PATCH] arm64: skip dump_backtrace() in show_regs when user mode pt_regs Will Deacon
2019-04-03 15:58   ` Kefeng Wang
2019-04-05 16:42     ` Will Deacon
2019-04-07  7:38       ` Kefeng Wang
2019-04-08 17:05         ` Will Deacon

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=20190328114527.171178-1-wangkefeng.wang@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.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).