debug: show pfn info when undefined instr happens at user space [1/1]
authorJiamin Ma <jiamin.ma@amlogic.com>
Wed, 12 Dec 2018 09:37:01 +0000 (17:37 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 13 Dec 2018 02:18:55 +0000 (18:18 -0800)
PD#SWPL-3076

Problem:
Lack of debug infos when undefined instr happens at user space

Solution:
Call show_all_pfn when undefined instr happens at user space

Verify:
Locally on ampere

Change-Id: Id24e797c2781c94c507ad07ec17a3d4ae7d44cd9
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
arch/arm/kernel/traps.c
arch/arm64/kernel/traps.c

index 6a32470..95cf506 100644 (file)
@@ -491,6 +491,10 @@ die_sig:
        if (user_debug & UDBG_UNDEFINED) {
                pr_info("%s (%d): undefined instruction: pc=%p\n",
                        current->comm, task_pid_nr(current), pc);
+#ifdef CONFIG_AMLOGIC_USER_FAULT
+               if (user_fault_debug_ratelimited())
+                       show_all_pfn(current, regs);
+#endif
                __show_regs(regs);
                dump_instr(KERN_INFO, regs);
        }
index 6e2d130..5f2f085 100644 (file)
@@ -418,6 +418,10 @@ static void force_signal_inject(int signal, int code, struct pt_regs *regs,
            show_unhandled_signals_ratelimited()) {
                pr_info("%s[%d]: %s: pc=%p\n",
                        current->comm, task_pid_nr(current), desc, pc);
+#ifdef CONFIG_AMLOGIC_USER_FAULT
+               show_all_pfn(current, regs);
+               show_regs(regs);
+#endif
                dump_instr(KERN_INFO, regs);
        }