Skip to content

Commit e64a547

Browse files
olsajiriMartin Schwidefsky
authored andcommitted
s390/ftrace/jprobes: Fix conflict between jprobes and function graph tracing
This fixes the same issue Steven already fixed for x86 in following commit: 237d28d ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing It fixes the crash, that happens when function graph tracing and jprobes are used simultaneously. Please refer to above commit for details. Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]> Acked-by: Steven Rostedt <[email protected]>
1 parent 68c5cf5 commit e64a547

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arch/s390/kernel/kprobes.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
690690
stack = (unsigned long) regs->gprs[15];
691691

692692
memcpy(kcb->jprobes_stack, (void *) stack, MIN_STACK_SIZE(stack));
693+
694+
/*
695+
* jprobes use jprobe_return() which skips the normal return
696+
* path of the function, and this messes up the accounting of the
697+
* function graph tracer to get messed up.
698+
*
699+
* Pause function graph tracing while performing the jprobe function.
700+
*/
701+
pause_graph_tracing();
693702
return 1;
694703
}
695704
NOKPROBE_SYMBOL(setjmp_pre_handler);
@@ -705,6 +714,9 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
705714
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
706715
unsigned long stack;
707716

717+
/* It's OK to start function graph tracing again */
718+
unpause_graph_tracing();
719+
708720
stack = (unsigned long) kcb->jprobe_saved_regs.gprs[15];
709721

710722
/* Put the regs back */

0 commit comments

Comments
 (0)