Lines Matching +full:bl +full:- +full:code +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <asm/debug-monitors.h>
33 * Carefully read and modify the code with aarch64_insn_*() which uses in ftrace_modify_code()
39 return -EFAULT; in ftrace_modify_code()
42 return -EINVAL; in ftrace_modify_code()
45 return -EPERM; in ftrace_modify_code()
68 struct plt_entry *plt = mod->arch.ftrace_trampolines; in get_ftrace_plt()
82 * Due to the limited range of 'BL' instructions, modules may be placed too far
92 unsigned long pc = rec->ip; in ftrace_find_callable_addr()
93 long offset = (long)*addr - (long)pc; in ftrace_find_callable_addr() local
97 * When the target is within range of the 'BL' instruction, use 'addr' in ftrace_find_callable_addr()
98 * as-is and branch to that directly. in ftrace_find_callable_addr()
100 if (offset >= -SZ_128M && offset < SZ_128M) in ftrace_find_callable_addr()
104 * When the target is outside of the range of a 'BL' instruction, we in ftrace_find_callable_addr()
106 * only when module PLT support is built-in. in ftrace_find_callable_addr()
113 * dealing with an out-of-range condition, we can assume it in ftrace_find_callable_addr()
118 * retains its validity throughout the remainder of this code. in ftrace_find_callable_addr()
144 unsigned long pc = rec->ip; in ftrace_make_call()
148 return -EINVAL; in ftrace_make_call()
160 unsigned long pc = rec->ip; in ftrace_modify_call()
164 return -EINVAL; in ftrace_modify_call()
166 return -EINVAL; in ftrace_modify_call()
177 * All instrumented functions follow the AAPCS, so x0-x8 and x19-x30 are live,
178 * and x9-x18 are free for our use.
180 * At runtime we want to be able to swing a single NOP <-> BL to enable or
181 * disable the ftrace call. The BL requires us to save the original LR value,
186 * +----------+------------+------------+
188 * | NOP | NOP | BL <entry> |
194 * Note: ftrace_process_locs() has pre-adjusted rec->ip to be the address of
195 * the BL.
199 unsigned long pc = rec->ip - AARCH64_INSN_SIZE; in ftrace_init_nop()
216 unsigned long pc = rec->ip; in ftrace_make_nop()
236 return -EINVAL; in ftrace_make_nop()
270 if (unlikely(atomic_read(¤t->tracing_graph_pause))) in prepare_ftrace_return()