Commit fc682f7b authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar

s390/kprobes: Remove jprobe implementation

Remove arch dependent setjump/longjump functions
and unused fields in kprobe_ctlblk for jprobes
from arch/s390.
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Link: https://lore.kernel.org/lkml/152942453967.15209.8535227381029256754.stgit@devboxSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 8c2c3f2d
...@@ -68,8 +68,6 @@ struct kprobe_ctlblk { ...@@ -68,8 +68,6 @@ struct kprobe_ctlblk {
unsigned long kprobe_saved_imask; unsigned long kprobe_saved_imask;
unsigned long kprobe_saved_ctl[3]; unsigned long kprobe_saved_ctl[3];
struct prev_kprobe prev_kprobe; struct prev_kprobe prev_kprobe;
struct pt_regs jprobe_saved_regs;
kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE];
}; };
void arch_remove_kprobe(struct kprobe *p); void arch_remove_kprobe(struct kprobe *p);
......
...@@ -321,9 +321,8 @@ static int kprobe_handler(struct pt_regs *regs) ...@@ -321,9 +321,8 @@ static int kprobe_handler(struct pt_regs *regs)
* If we have no pre-handler or it returned 0, we * If we have no pre-handler or it returned 0, we
* continue with single stepping. If we have a * continue with single stepping. If we have a
* pre-handler and it returned non-zero, it prepped * pre-handler and it returned non-zero, it prepped
* for calling the break_handler below on re-entry * for changing execution path, so get out doing
* for jprobe processing, so get out doing nothing * nothing more here.
* more here.
*/ */
push_kprobe(kcb, p); push_kprobe(kcb, p);
kcb->kprobe_status = KPROBE_HIT_ACTIVE; kcb->kprobe_status = KPROBE_HIT_ACTIVE;
...@@ -661,60 +660,6 @@ int kprobe_exceptions_notify(struct notifier_block *self, ...@@ -661,60 +660,6 @@ int kprobe_exceptions_notify(struct notifier_block *self,
} }
NOKPROBE_SYMBOL(kprobe_exceptions_notify); NOKPROBE_SYMBOL(kprobe_exceptions_notify);
int 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();
unsigned long stack;
memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs));
/* setup return addr to the jprobe handler routine */
regs->psw.addr = (unsigned long) jp->entry;
regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT);
/* r15 is the stack pointer */
stack = (unsigned long) regs->gprs[15];
memcpy(kcb->jprobes_stack, (void *) stack, MIN_STACK_SIZE(stack));
/*
* jprobes use jprobe_return() which skips the normal return
* path of the function, and this messes up the accounting of the
* function graph tracer to get messed up.
*
* Pause function graph tracing while performing the jprobe function.
*/
pause_graph_tracing();
return 1;
}
NOKPROBE_SYMBOL(setjmp_pre_handler);
void jprobe_return(void)
{
asm volatile(".word 0x0002");
}
NOKPROBE_SYMBOL(jprobe_return);
int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
{
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
unsigned long stack;
/* It's OK to start function graph tracing again */
unpause_graph_tracing();
stack = (unsigned long) kcb->jprobe_saved_regs.gprs[15];
/* Put the regs back */
memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs));
/* put the stack back */
memcpy((void *) stack, kcb->jprobes_stack, MIN_STACK_SIZE(stack));
preempt_enable_no_resched();
return 1;
}
NOKPROBE_SYMBOL(longjmp_break_handler);
static struct kprobe trampoline = { static struct kprobe trampoline = {
.addr = (kprobe_opcode_t *) &kretprobe_trampoline, .addr = (kprobe_opcode_t *) &kretprobe_trampoline,
.pre_handler = trampoline_probe_handler .pre_handler = trampoline_probe_handler
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment