diff options
author | Helge Deller <deller@gmx.de> | 2016-09-24 15:45:46 -0400 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2016-09-24 15:45:46 -0400 |
commit | b391667eb45a5a888bc9372462c5f647418c31af (patch) | |
tree | 9ff484ba4e08da9f261fccd22d1cf3767f8ad036 | |
parent | 910a86435dd75d7c04d9fbd49aa92e1842d6e88d (diff) |
parisc: Report trap type as human readable string
When faulting on some trap, the kernel currently reports in dmesg:
do_page_fault() command='perl' type=6 address=0xbe400403 in libcrypt-2.24.so[f9086000+9000]
vm_start = 0x00922000, vm_end = 0x00aed000
With this change the trap type additionally gets reported as human readable
string which makes it simpler to recognize the type of problem:
do_page_fault() command='perl' type=6 address=0xbe400403 in libcrypt-2.24.so[f9086000+9000]
trap #6: Instruction TLB miss fault, vm_start = 0x00922000, vm_end = 0x00aed000
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | arch/parisc/mm/fault.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 163af2c31d76..47a6ca4c9e40 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -168,6 +168,43 @@ int fixup_exception(struct pt_regs *regs) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * parisc hardware trap list | ||
172 | * | ||
173 | * Documented in section 3 "Addressing and Access Control" of the | ||
174 | * "PA-RISC 1.1 Architecture and Instruction Set Reference Manual" | ||
175 | * https://parisc.wiki.kernel.org/index.php/File:Pa11_acd.pdf | ||
176 | * | ||
177 | * For implementation see handle_interruption() in traps.c | ||
178 | */ | ||
179 | static const char * const trap_description[] = { | ||
180 | [1] "High-priority machine check (HPMC)", | ||
181 | [2] "Power failure interrupt", | ||
182 | [3] "Recovery counter trap", | ||
183 | [5] "Low-priority machine check", | ||
184 | [6] "Instruction TLB miss fault", | ||
185 | [7] "Instruction access rights / protection trap", | ||
186 | [8] "Illegal instruction trap", | ||
187 | [9] "Break instruction trap", | ||
188 | [10] "Privileged operation trap", | ||
189 | [11] "Privileged register trap", | ||
190 | [12] "Overflow trap", | ||
191 | [13] "Conditional trap", | ||
192 | [14] "FP Assist Exception trap", | ||
193 | [15] "Data TLB miss fault", | ||
194 | [16] "Non-access ITLB miss fault", | ||
195 | [17] "Non-access DTLB miss fault", | ||
196 | [18] "Data memory protection/unaligned access trap", | ||
197 | [19] "Data memory break trap", | ||
198 | [20] "TLB dirty bit trap", | ||
199 | [21] "Page reference trap", | ||
200 | [22] "Assist emulation trap", | ||
201 | [25] "Taken branch trap", | ||
202 | [26] "Data memory access rights trap", | ||
203 | [27] "Data memory protection ID trap", | ||
204 | [28] "Unaligned data reference trap", | ||
205 | }; | ||
206 | |||
207 | /* | ||
171 | * Print out info about fatal segfaults, if the show_unhandled_signals | 208 | * Print out info about fatal segfaults, if the show_unhandled_signals |
172 | * sysctl is set: | 209 | * sysctl is set: |
173 | */ | 210 | */ |
@@ -176,6 +213,8 @@ show_signal_msg(struct pt_regs *regs, unsigned long code, | |||
176 | unsigned long address, struct task_struct *tsk, | 213 | unsigned long address, struct task_struct *tsk, |
177 | struct vm_area_struct *vma) | 214 | struct vm_area_struct *vma) |
178 | { | 215 | { |
216 | const char *trap_name = NULL; | ||
217 | |||
179 | if (!unhandled_signal(tsk, SIGSEGV)) | 218 | if (!unhandled_signal(tsk, SIGSEGV)) |
180 | return; | 219 | return; |
181 | 220 | ||
@@ -186,8 +225,15 @@ show_signal_msg(struct pt_regs *regs, unsigned long code, | |||
186 | pr_warn("do_page_fault() command='%s' type=%lu address=0x%08lx", | 225 | pr_warn("do_page_fault() command='%s' type=%lu address=0x%08lx", |
187 | tsk->comm, code, address); | 226 | tsk->comm, code, address); |
188 | print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); | 227 | print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); |
228 | |||
229 | if (code < ARRAY_SIZE(trap_description)) | ||
230 | trap_name = trap_description[code]; | ||
231 | pr_warn(KERN_CONT " trap #%lu: %s%c", code, | ||
232 | trap_name ? trap_name : "unknown", | ||
233 | vma ? ',':'\n'); | ||
234 | |||
189 | if (vma) | 235 | if (vma) |
190 | pr_warn(" vm_start = 0x%08lx, vm_end = 0x%08lx\n", | 236 | pr_warn(KERN_CONT " vm_start = 0x%08lx, vm_end = 0x%08lx\n", |
191 | vma->vm_start, vma->vm_end); | 237 | vma->vm_start, vma->vm_end); |
192 | 238 | ||
193 | show_regs(regs); | 239 | show_regs(regs); |