• Home
  • Raw
  • Download

Lines Matching +full:bl +full:- +full:code +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <asm/debug-monitors.h>
23 int offset; member
29 .offset = offsetof(struct ftrace_regs, field), \
55 if (!strcmp(roff->name, name)) in ftrace_regs_query_register_offset()
56 return roff->offset; in ftrace_regs_query_register_offset()
59 return -EINVAL; in ftrace_regs_query_register_offset()
73 * When using patchable-function-entry without pre-function NOPS, addr in ftrace_call_adjust()
79 * addr+04: NOP // To be patched to BL <caller> in ftrace_call_adjust()
83 * addr-04: BTI C in ftrace_call_adjust()
85 * addr+04: NOP // To be patched to BL <caller> in ftrace_call_adjust()
88 * to `BL <caller>`, which is at `addr + 4` bytes in either case. in ftrace_call_adjust()
95 * When using patchable-function-entry with pre-function NOPs, addr is in ftrace_call_adjust()
96 * the address of the first pre-function NOP. in ftrace_call_adjust()
98 * Starting from an 8-byte aligned base, the compiler has either in ftrace_call_adjust()
104 * addr+12: NOP // To be patched to BL <caller> in ftrace_call_adjust()
112 * addr+16: NOP // To be patched to BL <caller> in ftrace_call_adjust()
115 * to `BL <caller>`, which is at either addr+12 or addr+16 depending on in ftrace_call_adjust()
120 WARN_RATELIMIT(1, "Misaligned patch-site %pS\n", in ftrace_call_adjust()
135 WARN_RATELIMIT(1, "unexpected insn in patch-site %pS: 0x%08x\n", in ftrace_call_adjust()
159 * Carefully read and modify the code with aarch64_insn_*() which uses in ftrace_modify_code()
165 return -EFAULT; in ftrace_modify_code()
168 return -EINVAL; in ftrace_modify_code()
171 return -EPERM; in ftrace_modify_code()
201 struct plt_entry *plt = mod->arch.ftrace_trampolines; in get_ftrace_plt()
211 long offset = (long)addr - (long)pc; in reachable_by_bl() local
213 return offset >= -SZ_128M && offset < SZ_128M; in reachable_by_bl()
219 * Due to the limited range of 'BL' instructions, modules may be placed too far
229 unsigned long pc = rec->ip; in ftrace_find_callable_addr()
235 * through ops->direct_call. in ftrace_find_callable_addr()
241 * When the target is within range of the 'BL' instruction, use 'addr' in ftrace_find_callable_addr()
242 * as-is and branch to that directly. in ftrace_find_callable_addr()
248 * When the target is outside of the range of a 'BL' instruction, we in ftrace_find_callable_addr()
250 * only when module PLT support is built-in. in ftrace_find_callable_addr()
257 * dealing with an out-of-range condition, we can assume it in ftrace_find_callable_addr()
262 * retains its validity throughout the remainder of this code. in ftrace_find_callable_addr()
288 if (rec->flags & FTRACE_FL_CALL_OPS_EN) { in arm64_rec_get_ops()
302 unsigned long literal = ALIGN_DOWN(rec->ip - 12, 8); in ftrace_rec_set_ops()
326 unsigned long pc = rec->ip; in ftrace_make_call()
335 return -EINVAL; in ftrace_make_call()
347 unsigned long pc = rec->ip; in ftrace_modify_call()
356 return -EINVAL; in ftrace_modify_call()
358 return -EINVAL; in ftrace_modify_call()
371 * All instrumented functions follow the AAPCS, so x0-x8 and x19-x30 are live,
372 * and x9-x18 are free for our use.
374 * At runtime we want to be able to swing a single NOP <-> BL to enable or
375 * disable the ftrace call. The BL requires us to save the original LR value,
380 * +----------+------------+------------+
382 * | NOP | NOP | BL <entry> |
388 * Note: ftrace_process_locs() has pre-adjusted rec->ip to be the address of
389 * the BL.
393 unsigned long pc = rec->ip - AARCH64_INSN_SIZE; in ftrace_init_nop()
415 unsigned long pc = rec->ip; in ftrace_make_nop()
438 return -EINVAL; in ftrace_make_nop()
464 if (unlikely(atomic_read(&current->tracing_graph_pause))) in prepare_ftrace_return()
484 prepare_ftrace_return(ip, &fregs->lr, fregs->fp); in ftrace_graph_func()