]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.7/s390-function_graph-simplify-with-function_graph_enter.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.19.7 / s390-function_graph-simplify-with-function_graph_enter.patch
CommitLineData
91d67d0f
GKH
1From 18588e1487b19e45bd90bd55ec8d3a1d44f3257f Mon Sep 17 00:00:00 2001
2From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
3Date: Sun, 18 Nov 2018 17:33:17 -0500
4Subject: s390/function_graph: Simplify with function_graph_enter()
5
6From: Steven Rostedt (VMware) <rostedt@goodmis.org>
7
8commit 18588e1487b19e45bd90bd55ec8d3a1d44f3257f upstream.
9
10The function_graph_enter() function does the work of calling the function
11graph hook function and the management of the shadow stack, simplifying the
12work done in the architecture dependent prepare_ftrace_return().
13
14Have s390 use the new code, and remove the shadow stack management as well as
15having to set up the trace structure.
16
17This is needed to prepare for a fix of a design bug on how the curr_ret_stack
18is used.
19
20Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
21Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
22Cc: Julian Wiedmann <jwi@linux.ibm.com>
23Cc: linux-s390@vger.kernel.org
24Cc: stable@kernel.org
25Fixes: 03274a3ffb449 ("tracing/fgraph: Adjust fgraph depth before calling trace return callback")
26Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
27Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30---
31 arch/s390/kernel/ftrace.c | 13 ++-----------
32 1 file changed, 2 insertions(+), 11 deletions(-)
33
34--- a/arch/s390/kernel/ftrace.c
35+++ b/arch/s390/kernel/ftrace.c
36@@ -203,22 +203,13 @@ device_initcall(ftrace_plt_init);
37 */
38 unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip)
39 {
40- struct ftrace_graph_ent trace;
41-
42 if (unlikely(ftrace_graph_is_dead()))
43 goto out;
44 if (unlikely(atomic_read(&current->tracing_graph_pause)))
45 goto out;
46 ip -= MCOUNT_INSN_SIZE;
47- trace.func = ip;
48- trace.depth = current->curr_ret_stack + 1;
49- /* Only trace if the calling function expects to. */
50- if (!ftrace_graph_entry(&trace))
51- goto out;
52- if (ftrace_push_return_trace(parent, ip, &trace.depth, 0,
53- NULL) == -EBUSY)
54- goto out;
55- parent = (unsigned long) return_to_handler;
56+ if (!function_graph_enter(parent, ip, 0, NULL))
57+ parent = (unsigned long) return_to_handler;
58 out:
59 return parent;
60 }