On Wed, May 18, 2022 at 3:53 PM Xu Kuohai xukuohai@huawei.com wrote:
Add ftrace direct support for arm64.
When there is custom trampoline only, replace the fentry nop to a jump instruction that jumps directly to the custom trampoline.
When ftrace trampoline and custom trampoline coexist, jump from fentry to ftrace trampoline first, then jump to custom trampoline when ftrace trampoline exits. The current unused register pt_regs->orig_x0 is used as an intermediary for jumping from ftrace trampoline to custom trampoline.
Signed-off-by: Xu Kuohai xukuohai@huawei.com Acked-by: Song Liu songliubraving@fb.com
Acked-by: KP Singh kpsingh@kernel.org