diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2016-02-24 08:27:46 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-03-02 07:44:27 -0500 |
commit | 5d7eccecf8621e3cf5adcec9cf80aa444b4610d4 (patch) | |
tree | 2877577833d43948398da7b0b79b34720aba9d37 /arch/s390/mm | |
parent | ee8479bb97dc790904e9afad503ae833e28ed8d3 (diff) |
s390/fault: merge report_user_fault implementations
We have two close to identical report_user_fault functions.
Add a parameter to one and get rid of the other one in order
to reduce code duplication.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/fault.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 791a4146052c..64b3ad1d6575 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -183,6 +183,8 @@ static void dump_fault_info(struct pt_regs *regs) | |||
183 | { | 183 | { |
184 | unsigned long asce; | 184 | unsigned long asce; |
185 | 185 | ||
186 | pr_alert("Failing address: %016lx TEID: %016lx\n", | ||
187 | regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long); | ||
186 | pr_alert("Fault in "); | 188 | pr_alert("Fault in "); |
187 | switch (regs->int_parm_long & 3) { | 189 | switch (regs->int_parm_long & 3) { |
188 | case 3: | 190 | case 3: |
@@ -218,7 +220,9 @@ static void dump_fault_info(struct pt_regs *regs) | |||
218 | dump_pagetable(asce, regs->int_parm_long & __FAIL_ADDR_MASK); | 220 | dump_pagetable(asce, regs->int_parm_long & __FAIL_ADDR_MASK); |
219 | } | 221 | } |
220 | 222 | ||
221 | static inline void report_user_fault(struct pt_regs *regs, long signr) | 223 | int show_unhandled_signals = 1; |
224 | |||
225 | void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault) | ||
222 | { | 226 | { |
223 | if ((task_pid_nr(current) > 1) && !show_unhandled_signals) | 227 | if ((task_pid_nr(current) > 1) && !show_unhandled_signals) |
224 | return; | 228 | return; |
@@ -230,9 +234,8 @@ static inline void report_user_fault(struct pt_regs *regs, long signr) | |||
230 | regs->int_code & 0xffff, regs->int_code >> 17); | 234 | regs->int_code & 0xffff, regs->int_code >> 17); |
231 | print_vma_addr(KERN_CONT "in ", regs->psw.addr); | 235 | print_vma_addr(KERN_CONT "in ", regs->psw.addr); |
232 | printk(KERN_CONT "\n"); | 236 | printk(KERN_CONT "\n"); |
233 | printk(KERN_ALERT "failing address: %016lx TEID: %016lx\n", | 237 | if (is_mm_fault) |
234 | regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long); | 238 | dump_fault_info(regs); |
235 | dump_fault_info(regs); | ||
236 | show_regs(regs); | 239 | show_regs(regs); |
237 | } | 240 | } |
238 | 241 | ||
@@ -244,7 +247,7 @@ static noinline void do_sigsegv(struct pt_regs *regs, int si_code) | |||
244 | { | 247 | { |
245 | struct siginfo si; | 248 | struct siginfo si; |
246 | 249 | ||
247 | report_user_fault(regs, SIGSEGV); | 250 | report_user_fault(regs, SIGSEGV, 1); |
248 | si.si_signo = SIGSEGV; | 251 | si.si_signo = SIGSEGV; |
249 | si.si_code = si_code; | 252 | si.si_code = si_code; |
250 | si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK); | 253 | si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK); |
@@ -272,8 +275,6 @@ static noinline void do_no_context(struct pt_regs *regs) | |||
272 | else | 275 | else |
273 | printk(KERN_ALERT "Unable to handle kernel paging request" | 276 | printk(KERN_ALERT "Unable to handle kernel paging request" |
274 | " in virtual user address space\n"); | 277 | " in virtual user address space\n"); |
275 | printk(KERN_ALERT "failing address: %016lx TEID: %016lx\n", | ||
276 | regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long); | ||
277 | dump_fault_info(regs); | 278 | dump_fault_info(regs); |
278 | die(regs, "Oops"); | 279 | die(regs, "Oops"); |
279 | do_exit(SIGKILL); | 280 | do_exit(SIGKILL); |