aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/fault_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/fault_64.c')
-rw-r--r--arch/sparc/mm/fault_64.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c
index 43b0da96a4fb..6081936bf03b 100644
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -31,13 +31,12 @@
31#include <asm/sections.h> 31#include <asm/sections.h>
32#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
33 33
34#ifdef CONFIG_KPROBES 34static inline __kprobes int notify_page_fault(struct pt_regs *regs)
35static inline int notify_page_fault(struct pt_regs *regs)
36{ 35{
37 int ret = 0; 36 int ret = 0;
38 37
39 /* kprobe_running() needs smp_processor_id() */ 38 /* kprobe_running() needs smp_processor_id() */
40 if (!user_mode(regs)) { 39 if (kprobes_built_in() && !user_mode(regs)) {
41 preempt_disable(); 40 preempt_disable();
42 if (kprobe_running() && kprobe_fault_handler(regs, 0)) 41 if (kprobe_running() && kprobe_fault_handler(regs, 0))
43 ret = 1; 42 ret = 1;
@@ -45,12 +44,6 @@ static inline int notify_page_fault(struct pt_regs *regs)
45 } 44 }
46 return ret; 45 return ret;
47} 46}
48#else
49static inline int notify_page_fault(struct pt_regs *regs)
50{
51 return 0;
52}
53#endif
54 47
55static void __kprobes unhandled_fault(unsigned long address, 48static void __kprobes unhandled_fault(unsigned long address,
56 struct task_struct *tsk, 49 struct task_struct *tsk,
@@ -73,7 +66,7 @@ static void __kprobes unhandled_fault(unsigned long address,
73 die_if_kernel("Oops", regs); 66 die_if_kernel("Oops", regs);
74} 67}
75 68
76static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr) 69static void __kprobes bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
77{ 70{
78 printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n", 71 printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
79 regs->tpc); 72 regs->tpc);
@@ -170,8 +163,9 @@ static unsigned int get_fault_insn(struct pt_regs *regs, unsigned int insn)
170 return insn; 163 return insn;
171} 164}
172 165
173static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code, 166static void __kprobes do_kernel_fault(struct pt_regs *regs, int si_code,
174 unsigned int insn, unsigned long address) 167 int fault_code, unsigned int insn,
168 unsigned long address)
175{ 169{
176 unsigned char asi = ASI_P; 170 unsigned char asi = ASI_P;
177 171
@@ -225,7 +219,7 @@ cannot_handle:
225 unhandled_fault (address, current, regs); 219 unhandled_fault (address, current, regs);
226} 220}
227 221
228static void noinline bogus_32bit_fault_tpc(struct pt_regs *regs) 222static void noinline __kprobes bogus_32bit_fault_tpc(struct pt_regs *regs)
229{ 223{
230 static int times; 224 static int times;
231 225
@@ -237,8 +231,8 @@ static void noinline bogus_32bit_fault_tpc(struct pt_regs *regs)
237 show_regs(regs); 231 show_regs(regs);
238} 232}
239 233
240static void noinline bogus_32bit_fault_address(struct pt_regs *regs, 234static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs,
241 unsigned long addr) 235 unsigned long addr)
242{ 236{
243 static int times; 237 static int times;
244 238