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/kernel/traps.c | |
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/kernel/traps.c')
-rw-r--r-- | arch/s390/kernel/traps.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 017eb03daee2..dd97a3e8a34a 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c | |||
@@ -22,8 +22,6 @@ | |||
22 | #include <asm/fpu/api.h> | 22 | #include <asm/fpu/api.h> |
23 | #include "entry.h" | 23 | #include "entry.h" |
24 | 24 | ||
25 | int show_unhandled_signals = 1; | ||
26 | |||
27 | static inline void __user *get_trap_ip(struct pt_regs *regs) | 25 | static inline void __user *get_trap_ip(struct pt_regs *regs) |
28 | { | 26 | { |
29 | unsigned long address; | 27 | unsigned long address; |
@@ -35,21 +33,6 @@ static inline void __user *get_trap_ip(struct pt_regs *regs) | |||
35 | return (void __user *) (address - (regs->int_code >> 16)); | 33 | return (void __user *) (address - (regs->int_code >> 16)); |
36 | } | 34 | } |
37 | 35 | ||
38 | static inline void report_user_fault(struct pt_regs *regs, int signr) | ||
39 | { | ||
40 | if ((task_pid_nr(current) > 1) && !show_unhandled_signals) | ||
41 | return; | ||
42 | if (!unhandled_signal(current, signr)) | ||
43 | return; | ||
44 | if (!printk_ratelimit()) | ||
45 | return; | ||
46 | printk("User process fault: interruption code %04x ilc:%d ", | ||
47 | regs->int_code & 0xffff, regs->int_code >> 17); | ||
48 | print_vma_addr("in ", regs->psw.addr); | ||
49 | printk("\n"); | ||
50 | show_regs(regs); | ||
51 | } | ||
52 | |||
53 | int is_valid_bugaddr(unsigned long addr) | 36 | int is_valid_bugaddr(unsigned long addr) |
54 | { | 37 | { |
55 | return 1; | 38 | return 1; |
@@ -65,7 +48,7 @@ void do_report_trap(struct pt_regs *regs, int si_signo, int si_code, char *str) | |||
65 | info.si_code = si_code; | 48 | info.si_code = si_code; |
66 | info.si_addr = get_trap_ip(regs); | 49 | info.si_addr = get_trap_ip(regs); |
67 | force_sig_info(si_signo, &info, current); | 50 | force_sig_info(si_signo, &info, current); |
68 | report_user_fault(regs, si_signo); | 51 | report_user_fault(regs, si_signo, 0); |
69 | } else { | 52 | } else { |
70 | const struct exception_table_entry *fixup; | 53 | const struct exception_table_entry *fixup; |
71 | fixup = search_exception_tables(regs->psw.addr); | 54 | fixup = search_exception_tables(regs->psw.addr); |
@@ -111,7 +94,7 @@ NOKPROBE_SYMBOL(do_per_trap); | |||
111 | void default_trap_handler(struct pt_regs *regs) | 94 | void default_trap_handler(struct pt_regs *regs) |
112 | { | 95 | { |
113 | if (user_mode(regs)) { | 96 | if (user_mode(regs)) { |
114 | report_user_fault(regs, SIGSEGV); | 97 | report_user_fault(regs, SIGSEGV, 0); |
115 | do_exit(SIGSEGV); | 98 | do_exit(SIGSEGV); |
116 | } else | 99 | } else |
117 | die(regs, "Unknown program exception"); | 100 | die(regs, "Unknown program exception"); |