diff options
Diffstat (limited to 'arch/parisc/mm')
-rw-r--r-- | arch/parisc/mm/fault.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 9d08c71a967e..d72197f0ddb8 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -19,10 +19,6 @@ | |||
19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
20 | #include <asm/traps.h> | 20 | #include <asm/traps.h> |
21 | 21 | ||
22 | #define PRINT_USER_FAULTS /* (turn this on if you want user faults to be */ | ||
23 | /* dumped to the console via printk) */ | ||
24 | |||
25 | |||
26 | /* Various important other fields */ | 22 | /* Various important other fields */ |
27 | #define bit22set(x) (x & 0x00000200) | 23 | #define bit22set(x) (x & 0x00000200) |
28 | #define bits23_25set(x) (x & 0x000001c0) | 24 | #define bits23_25set(x) (x & 0x000001c0) |
@@ -34,6 +30,8 @@ | |||
34 | 30 | ||
35 | DEFINE_PER_CPU(struct exception_data, exception_data); | 31 | DEFINE_PER_CPU(struct exception_data, exception_data); |
36 | 32 | ||
33 | int show_unhandled_signals = 1; | ||
34 | |||
37 | /* | 35 | /* |
38 | * parisc_acctyp(unsigned int inst) -- | 36 | * parisc_acctyp(unsigned int inst) -- |
39 | * Given a PA-RISC memory access instruction, determine if the | 37 | * Given a PA-RISC memory access instruction, determine if the |
@@ -173,6 +171,32 @@ int fixup_exception(struct pt_regs *regs) | |||
173 | return 0; | 171 | return 0; |
174 | } | 172 | } |
175 | 173 | ||
174 | /* | ||
175 | * Print out info about fatal segfaults, if the show_unhandled_signals | ||
176 | * sysctl is set: | ||
177 | */ | ||
178 | static inline void | ||
179 | show_signal_msg(struct pt_regs *regs, unsigned long code, | ||
180 | unsigned long address, struct task_struct *tsk, | ||
181 | struct vm_area_struct *vma) | ||
182 | { | ||
183 | if (!unhandled_signal(tsk, SIGSEGV)) | ||
184 | return; | ||
185 | |||
186 | if (!printk_ratelimit()) | ||
187 | return; | ||
188 | |||
189 | pr_warn("\n"); | ||
190 | pr_warn("do_page_fault() command='%s' type=%lu address=0x%08lx", | ||
191 | tsk->comm, code, address); | ||
192 | print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); | ||
193 | if (vma) | ||
194 | pr_warn(" vm_start = 0x%08lx, vm_end = 0x%08lx\n", | ||
195 | vma->vm_start, vma->vm_end); | ||
196 | |||
197 | show_regs(regs); | ||
198 | } | ||
199 | |||
176 | void do_page_fault(struct pt_regs *regs, unsigned long code, | 200 | void do_page_fault(struct pt_regs *regs, unsigned long code, |
177 | unsigned long address) | 201 | unsigned long address) |
178 | { | 202 | { |
@@ -270,16 +294,8 @@ bad_area: | |||
270 | if (user_mode(regs)) { | 294 | if (user_mode(regs)) { |
271 | struct siginfo si; | 295 | struct siginfo si; |
272 | 296 | ||
273 | #ifdef PRINT_USER_FAULTS | 297 | show_signal_msg(regs, code, address, tsk, vma); |
274 | printk(KERN_DEBUG "\n"); | 298 | |
275 | printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n", | ||
276 | task_pid_nr(tsk), tsk->comm, code, address); | ||
277 | if (vma) { | ||
278 | printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n", | ||
279 | vma->vm_start, vma->vm_end); | ||
280 | } | ||
281 | show_regs(regs); | ||
282 | #endif | ||
283 | switch (code) { | 299 | switch (code) { |
284 | case 15: /* Data TLB miss fault/Data page fault */ | 300 | case 15: /* Data TLB miss fault/Data page fault */ |
285 | /* send SIGSEGV when outside of vma */ | 301 | /* send SIGSEGV when outside of vma */ |