diff options
Diffstat (limited to 'arch/parisc/mm/fault.c')
-rw-r--r-- | arch/parisc/mm/fault.c | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 163af2c31d76..8ff9253930af 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -14,7 +14,7 @@ #include <linux/ptrace.h> #include <linux/sched.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/uaccess.h> #include <asm/traps.h> @@ -168,6 +168,53 @@ int fixup_exception(struct pt_regs *regs) } /* + * parisc hardware trap list + * + * Documented in section 3 "Addressing and Access Control" of the + * "PA-RISC 1.1 Architecture and Instruction Set Reference Manual" + * https://parisc.wiki.kernel.org/index.php/File:Pa11_acd.pdf + * + * For implementation see handle_interruption() in traps.c + */ +static const char * const trap_description[] = { + [1] "High-priority machine check (HPMC)", + [2] "Power failure interrupt", + [3] "Recovery counter trap", + [5] "Low-priority machine check", + [6] "Instruction TLB miss fault", + [7] "Instruction access rights / protection trap", + [8] "Illegal instruction trap", + [9] "Break instruction trap", + [10] "Privileged operation trap", + [11] "Privileged register trap", + [12] "Overflow trap", + [13] "Conditional trap", + [14] "FP Assist Exception trap", + [15] "Data TLB miss fault", + [16] "Non-access ITLB miss fault", + [17] "Non-access DTLB miss fault", + [18] "Data memory protection/unaligned access trap", + [19] "Data memory break trap", + [20] "TLB dirty bit trap", + [21] "Page reference trap", + [22] "Assist emulation trap", + [25] "Taken branch trap", + [26] "Data memory access rights trap", + [27] "Data memory protection ID trap", + [28] "Unaligned data reference trap", +}; + +const char *trap_name(unsigned long code) +{ + const char *t = NULL; + + if (code < ARRAY_SIZE(trap_description)) + t = trap_description[code]; + + return t ? t : "Unknown trap"; +} + +/* * Print out info about fatal segfaults, if the show_unhandled_signals * sysctl is set: */ @@ -186,8 +233,12 @@ show_signal_msg(struct pt_regs *regs, unsigned long code, pr_warn("do_page_fault() command='%s' type=%lu address=0x%08lx", tsk->comm, code, address); print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); + + pr_cont(" trap #%lu: %s%c", code, trap_name(code), + vma ? ',':'\n'); + if (vma) - pr_warn(" vm_start = 0x%08lx, vm_end = 0x%08lx\n", + pr_warn(KERN_CONT " vm_start = 0x%08lx, vm_end = 0x%08lx\n", vma->vm_start, vma->vm_end); show_regs(regs); |