aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2012-10-24 11:34:02 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2012-11-14 04:54:15 -0500
commit3495386b107510ba7014f42da37034648c1d2cfd (patch)
tree99529d66242420c3094b9de52fc8ffefd792681e /arch/arm64
parent77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff)
arm64: Make the user fault reporting more specific
For user space faults the kernel reports "unhandled page fault" and it gives the ESR value. With this patch the error message looked up in the fault info array to give a better description. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/mm/fault.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 1909a69983ca..afadae6682ed 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -36,6 +36,8 @@
36#include <asm/pgtable.h> 36#include <asm/pgtable.h>
37#include <asm/tlbflush.h> 37#include <asm/tlbflush.h>
38 38
39static const char *fault_name(unsigned int esr);
40
39/* 41/*
40 * Dump out the page tables associated with 'addr' in mm 'mm'. 42 * Dump out the page tables associated with 'addr' in mm 'mm'.
41 */ 43 */
@@ -112,8 +114,9 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr,
112 struct siginfo si; 114 struct siginfo si;
113 115
114 if (show_unhandled_signals) { 116 if (show_unhandled_signals) {
115 pr_info("%s[%d]: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", 117 pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n",
116 tsk->comm, task_pid_nr(tsk), sig, addr, esr); 118 tsk->comm, task_pid_nr(tsk), fault_name(esr), sig,
119 addr, esr);
117 show_pte(tsk->mm, addr); 120 show_pte(tsk->mm, addr);
118 show_regs(regs); 121 show_regs(regs);
119 } 122 }
@@ -450,6 +453,12 @@ static struct fault_info {
450 { do_bad, SIGBUS, 0, "unknown 63" }, 453 { do_bad, SIGBUS, 0, "unknown 63" },
451}; 454};
452 455
456static const char *fault_name(unsigned int esr)
457{
458 const struct fault_info *inf = fault_info + (esr & 63);
459 return inf->name;
460}
461
453/* 462/*
454 * Dispatch a data abort to the relevant handler. 463 * Dispatch a data abort to the relevant handler.
455 */ 464 */