ARM64:ftrace: fix ftrace_modify_graph_caller for branch replace
PATCH RESEND 1/1 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 9f1ae7596aad("arm64: Correct ftrace calls to aarch64_insn_gen_branch_imm()") did a typo and used AARCH64_INSN_BRANCH_LINK instead of AARCH64_INSN_BRANCH_NOLINK.
--- arch/arm64/kernel/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/ftrace.c +1 -1
@@ -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)
Signature · 1 line
2.1.0
PATCH RESEND 1/1 ARM64:ftrace: fix ftrace_modify_graph_caller for branch replace
Quoted 2 lines · Pratyush Anand
ftrace_enable_ftrace_graph_callerandftrace_disable_ftrace_graph_callershould replace B(jmp) instruction and not BL(call) instruction.
Thanks. I originally intended to use "b".
("bl" may also work anyway 'cause link register will be saved/restored around ftrace_caller().)
-Takahiro AKASHI
Quoted 23 lines
commit 9f1ae7596aad("arm64: Correct ftrace calls to
aarch64_insn_gen_branch_imm()") did a typo and usedAARCH64_INSN_BRANCH_LINKinstead ofAARCH64_INSN_BRANCH_NOLINK.Signed-off-by Pratyush Anand <[email protected]>--- arch/arm64/kernel/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kernel/ftrace.c +1
-1@@ -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)