Skip to content

Commit 3305a60

Browse files
Nicolas PitreRussell King
authored andcommitted
[ARM] 5206/1: remove kprobe_trap_handler() hack
As mentioned in commit 7969691, and because of commit b03a5b7, the direct calling of kprobe_trap_handler() can be removed. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent ac9d7ef commit 3305a60

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

arch/arm/include/asm/kprobes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct kprobe_ctlblk {
6161
void arch_remove_kprobe(struct kprobe *);
6262
void kretprobe_trampoline(void);
6363

64-
int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr);
6564
int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
6665
int kprobe_exceptions_notify(struct notifier_block *self,
6766
unsigned long val, void *data);

arch/arm/kernel/kprobes.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,12 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
200200
}
201201
}
202202

203-
int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr)
203+
static int __kprobes kprobe_trap_handler(struct pt_regs *regs, unsigned int instr)
204204
{
205+
unsigned long flags;
206+
local_irq_save(flags);
205207
kprobe_handler(regs);
208+
local_irq_restore(flags);
206209
return 0;
207210
}
208211

arch/arm/kernel/traps.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/kallsyms.h>
2020
#include <linux/delay.h>
2121
#include <linux/init.h>
22-
#include <linux/kprobes.h>
2322

2423
#include <asm/atomic.h>
2524
#include <asm/cacheflush.h>
@@ -328,17 +327,6 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
328327
get_user(instr, (u32 __user *)pc);
329328
}
330329

331-
#ifdef CONFIG_KPROBES
332-
/*
333-
* It is possible to have recursive kprobes, so we can't call
334-
* the kprobe trap handler with the undef_lock held.
335-
*/
336-
if (instr == KPROBE_BREAKPOINT_INSTRUCTION && !user_mode(regs)) {
337-
kprobe_trap_handler(regs, instr);
338-
return;
339-
}
340-
#endif
341-
342330
if (call_undef_hook(regs, instr) == 0)
343331
return;
344332

0 commit comments

Comments
 (0)