Commit 6b8ff511 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Catalin Marinas:
 "Fix the arm64 usage of ftrace_graph_ret_addr() to pass the
  &state->graph_idx pointer instead of NULL, otherwise this function
  just returns early"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: stacktrace: fix the usage of ftrace_graph_ret_addr()
parents 890daede c060f932
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
* *
* @common: Common unwind state. * @common: Common unwind state.
* @task: The task being unwound. * @task: The task being unwound.
* @graph_idx: Used by ftrace_graph_ret_addr() for optimized stack unwinding.
* @kr_cur: When KRETPROBES is selected, holds the kretprobe instance * @kr_cur: When KRETPROBES is selected, holds the kretprobe instance
* associated with the most recently encountered replacement lr * associated with the most recently encountered replacement lr
* value. * value.
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
struct kunwind_state { struct kunwind_state {
struct unwind_state common; struct unwind_state common;
struct task_struct *task; struct task_struct *task;
int graph_idx;
#ifdef CONFIG_KRETPROBES #ifdef CONFIG_KRETPROBES
struct llist_node *kr_cur; struct llist_node *kr_cur;
#endif #endif
...@@ -106,7 +108,7 @@ kunwind_recover_return_address(struct kunwind_state *state) ...@@ -106,7 +108,7 @@ kunwind_recover_return_address(struct kunwind_state *state)
if (state->task->ret_stack && if (state->task->ret_stack &&
(state->common.pc == (unsigned long)return_to_handler)) { (state->common.pc == (unsigned long)return_to_handler)) {
unsigned long orig_pc; unsigned long orig_pc;
orig_pc = ftrace_graph_ret_addr(state->task, NULL, orig_pc = ftrace_graph_ret_addr(state->task, &state->graph_idx,
state->common.pc, state->common.pc,
(void *)state->common.fp); (void *)state->common.fp);
if (WARN_ON_ONCE(state->common.pc == orig_pc)) if (WARN_ON_ONCE(state->common.pc == orig_pc))
......
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