Skip to content

Commit

Permalink
arm64: ftrace: fix ftrace_modify_graph_caller for branch replace
Browse files Browse the repository at this point in the history
ftrace_enable_ftrace_graph_caller and ftrace_disable_ftrace_graph_caller
should replace B(jmp) instruction and not BL(call) instruction.

Commit 9f1ae75("arm64: Correct ftrace calls to
aarch64_insn_gen_branch_imm()") had a typo and used
AARCH64_INSN_BRANCH_LINK instead of AARCH64_INSN_BRANCH_NOLINK.

Either instruction will work, as the link register is saved/restored
across the branch but this better matches the intention of the code.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Pratyush Anand authored and Will Deacon committed Feb 23, 2015
1 parent c517d83 commit d0d6223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm64/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static int ftrace_modify_graph_caller(bool enable)

branch = aarch64_insn_gen_branch_imm(pc,
(unsigned long)ftrace_graph_caller,
AARCH64_INSN_BRANCH_LINK);
AARCH64_INSN_BRANCH_NOLINK);
nop = aarch64_insn_gen_nop();

if (enable)
Expand Down

0 comments on commit d0d6223

Please sign in to comment.