linux-stable/arch/loongarch
Youling Tang 9cdc3b6a29 LoongArch: ftrace: Add direct call support
Select the HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS to provide the
register_ftrace_direct[_multi] interfaces allowing users to register
the customed trampoline (direct_caller) as the mcount for one or more
target functions. And modify_ftrace_direct[_multi] are also provided
for modifying direct_caller.

There are a few cases to distinguish:
- If a direct call ops is the only one tracing a function AND the direct
  called trampoline is within the reach of a 'bl' instruction
  -> the ftrace patchsite jumps to the trampoline
- Else
  -> the ftrace patchsite jumps to the ftrace_regs_caller trampoline points
     to ftrace_list_ops so it iterates over all registered ftrace ops,
     including the direct call ops and calls its call_direct_funcs handler
     which stores the direct called trampoline's address in the ftrace_regs
     and the ftrace_regs_caller trampoline will return to that address
     instead of returning to the traced function

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-05-01 17:19:53 +08:00
..
boot loongarch: efi: enable generic EFI compressed boot 2022-09-20 09:50:31 +02:00
configs LoongArch: kdump: Add single kernel image implementation 2023-02-25 22:12:17 +08:00
crypto LoongArch: crypto: Add crc32 and crc32c hw acceleration 2023-05-01 17:19:43 +08:00
include LoongArch: ftrace: Add direct call support 2023-05-01 17:19:53 +08:00
kernel LoongArch: ftrace: Add direct call support 2023-05-01 17:19:53 +08:00
lib LoongArch: Add support for function error injection 2023-05-01 17:19:52 +08:00
mm LoongArch: Mark 3 symbol exports as non-GPL 2023-04-18 19:38:58 +08:00
net LoongArch, bpf: Fix jit to skip speculation barrier opcode 2023-03-28 10:34:52 +02:00
pci LoongArch: Add FDT booting support from efi system table 2022-12-14 08:41:53 +08:00
power LoongArch: Enable PG when wakeup from suspend 2023-04-18 19:38:58 +08:00
vdso LoongArch: Fix build warnings in VDSO 2022-08-25 19:34:59 +08:00
Kbuild LoongArch: Add BPF JIT support 2022-10-12 16:36:20 +08:00
Kconfig LoongArch: ftrace: Add direct call support 2023-05-01 17:19:53 +08:00
Kconfig.debug LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
Makefile LoongArch: crypto: Add crc32 and crc32c hw acceleration 2023-05-01 17:19:43 +08:00