提交 d0d62230 编写于 作者: P Pratyush Anand 提交者: Will Deacon

arm64: ftrace: fix ftrace_modify_graph_caller for branch replace

ftrace_enable_ftrace_graph_caller and ftrace_disable_ftrace_graph_caller
should replace B(jmp) instruction and not BL(call) instruction.

Commit 9f1ae759("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: NPratyush Anand <panand@redhat.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 c517d838
...@@ -156,7 +156,7 @@ static int ftrace_modify_graph_caller(bool enable) ...@@ -156,7 +156,7 @@ static int ftrace_modify_graph_caller(bool enable)
branch = aarch64_insn_gen_branch_imm(pc, branch = aarch64_insn_gen_branch_imm(pc,
(unsigned long)ftrace_graph_caller, (unsigned long)ftrace_graph_caller,
AARCH64_INSN_BRANCH_LINK); AARCH64_INSN_BRANCH_NOLINK);
nop = aarch64_insn_gen_nop(); nop = aarch64_insn_gen_nop();
if (enable) if (enable)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册