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

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/lkml/152942442318.15209.17767976282305601884.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/arm64/include/asm/kprobes.h
arch/arm64/kernel/probes/kprobes.c

index 6deb8d726041eb9763efa84d4689ca24881d1e54..d5a44cf859e94284a1a38990105107fe3de28b2f 100644 (file)
@@ -48,7 +48,6 @@ struct kprobe_ctlblk {
        unsigned long saved_irqflag;
        struct prev_kprobe prev_kprobe;
        struct kprobe_step_ctx ss_ctx;
-       struct pt_regs jprobe_saved_regs;
 };
 
 void arch_remove_kprobe(struct kprobe *);
index d849d9804011df6eabb143ed68da8d260dd5074d..3ca2351109a637914de1a2681f2ef8e6402f919a 100644 (file)
@@ -465,74 +465,6 @@ kprobe_breakpoint_handler(struct pt_regs *regs, unsigned int esr)
        return DBG_HOOK_HANDLED;
 }
 
-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;
-       /*
-        * Since we can't be sure where in the stack frame "stacked"
-        * pass-by-value arguments are stored we just don't try to
-        * duplicate any of the stack. Do not use jprobes on functions that
-        * use more than 64 bytes (after padding each to an 8 byte boundary)
-        * of arguments, or pass individual arguments larger than 16 bytes.
-        */
-
-       instruction_pointer_set(regs, (unsigned long) jp->entry);
-       preempt_disable();
-       pause_graph_tracing();
-       return 1;
-}
-
-void __kprobes jprobe_return(void)
-{
-       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
-
-       /*
-        * Jprobe handler return by entering break exception,
-        * encoded same as kprobe, but with following conditions
-        * -a special PC to identify it from the other kprobes.
-        * -restore stack addr to original saved pt_regs
-        */
-       asm volatile("                          mov sp, %0      \n"
-                    "jprobe_return_break:      brk %1          \n"
-                    :
-                    : "r" (kcb->jprobe_saved_regs.sp),
-                      "I" (BRK64_ESR_KPROBES)
-                    : "memory");
-
-       unreachable();
-}
-
-int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
-{
-       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
-       long stack_addr = kcb->jprobe_saved_regs.sp;
-       long orig_sp = kernel_stack_pointer(regs);
-       struct jprobe *jp = container_of(p, struct jprobe, kp);
-       extern const char jprobe_return_break[];
-
-       if (instruction_pointer(regs) != (u64) jprobe_return_break)
-               return 0;
-
-       if (orig_sp != stack_addr) {
-               struct pt_regs *saved_regs =
-                   (struct pt_regs *)kcb->jprobe_saved_regs.sp;
-               pr_err("current sp %lx does not match saved sp %lx\n",
-                      orig_sp, stack_addr);
-               pr_err("Saved registers for jprobe %p\n", jp);
-               __show_regs(saved_regs);
-               pr_err("Current registers\n");
-               __show_regs(regs);
-               BUG();
-       }
-       unpause_graph_tracing();
-       *regs = kcb->jprobe_saved_regs;
-       preempt_enable_no_resched();
-       return 1;
-}
-
 bool arch_within_kprobe_blacklist(unsigned long addr)
 {
        if ((addr >= (unsigned long)__kprobes_text_start &&