MIPS/kprobes: Remove jprobe implementation
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 19 Jun 2018 16:08:30 +0000 (01:08 +0900)
committerIngo Molnar <mingo@kernel.org>
Thu, 21 Jun 2018 10:33:09 +0000 (12:33 +0200)
Remove arch dependent setjump/longjump functions
and unused fields in kprobe_ctlblk for jprobes
from arch/mips.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-mips@linux-mips.org
Link: https://lore.kernel.org/lkml/152942451058.15209.3459785416221980965.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/mips/include/asm/kprobes.h
arch/mips/kernel/kprobes.c

index ad1a99948f2795c0608c32e3dc213c46e171d162..a72dfbf1babb10da565d425330fbcf515344d526 100644 (file)
@@ -68,16 +68,6 @@ struct prev_kprobe {
        unsigned long saved_epc;
 };
 
-#define MAX_JPROBES_STACK_SIZE 128
-#define MAX_JPROBES_STACK_ADDR \
-       (((unsigned long)current_thread_info()) + THREAD_SIZE - 32 - sizeof(struct pt_regs))
-
-#define MIN_JPROBES_STACK_SIZE(ADDR)                                   \
-       ((((ADDR) + MAX_JPROBES_STACK_SIZE) > MAX_JPROBES_STACK_ADDR)   \
-               ? MAX_JPROBES_STACK_ADDR - (ADDR)                       \
-               : MAX_JPROBES_STACK_SIZE)
-
-
 #define SKIP_DELAYSLOT 0x0001
 
 /* per-cpu kprobe control block */
@@ -86,12 +76,9 @@ struct kprobe_ctlblk {
        unsigned long kprobe_old_SR;
        unsigned long kprobe_saved_SR;
        unsigned long kprobe_saved_epc;
-       unsigned long jprobe_saved_sp;
-       struct pt_regs jprobe_saved_regs;
        /* Per-thread fields, used while emulating branches */
        unsigned long flags;
        unsigned long target_epc;
-       u8 jprobes_stack[MAX_JPROBES_STACK_SIZE];
        struct prev_kprobe prev_kprobe;
 };
 
index f5c8bce70db29cb59430cdf0bd46d4fccb80aee8..efdcd0b1ce127ccce61af5ba26deb9d8980e6e83 100644 (file)
@@ -468,51 +468,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        return ret;
 }
 
-int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
-{
-       struct jprobe *jp = container_of(p, struct jprobe, kp);
-       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
-
-       kcb->jprobe_saved_regs = *regs;
-       kcb->jprobe_saved_sp = regs->regs[29];
-
-       memcpy(kcb->jprobes_stack, (void *)kcb->jprobe_saved_sp,
-              MIN_JPROBES_STACK_SIZE(kcb->jprobe_saved_sp));
-
-       regs->cp0_epc = (unsigned long)(jp->entry);
-
-       return 1;
-}
-
-/* Defined in the inline asm below. */
-void jprobe_return_end(void);
-
-void __kprobes jprobe_return(void)
-{
-       /* Assembler quirk necessitates this '0,code' business.  */
-       asm volatile(
-               "break 0,%0\n\t"
-               ".globl jprobe_return_end\n"
-               "jprobe_return_end:\n"
-               : : "n" (BRK_KPROBE_BP) : "memory");
-}
-
-int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
-{
-       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
-
-       if (regs->cp0_epc >= (unsigned long)jprobe_return &&
-           regs->cp0_epc <= (unsigned long)jprobe_return_end) {
-               *regs = kcb->jprobe_saved_regs;
-               memcpy((void *)kcb->jprobe_saved_sp, kcb->jprobes_stack,
-                      MIN_JPROBES_STACK_SIZE(kcb->jprobe_saved_sp));
-               preempt_enable_no_resched();
-
-               return 1;
-       }
-       return 0;
-}
-
 /*
  * Function return probe trampoline:
  *     - init_kprobes() establishes a probepoint here