linux-stable/arch
Jiri Olsa f92c1e1836 bpf: Add get_func_[arg|ret|arg_cnt] helpers
Adding following helpers for tracing programs:

Get n-th argument of the traced function:
  long bpf_get_func_arg(void *ctx, u32 n, u64 *value)

Get return value of the traced function:
  long bpf_get_func_ret(void *ctx, u64 *value)

Get arguments count of the traced function:
  long bpf_get_func_arg_cnt(void *ctx)

The trampoline now stores number of arguments on ctx-8
address, so it's easy to verify argument index and find
return value argument's position.

Moving function ip address on the trampoline stack behind
the number of functions arguments, so it's now stored on
ctx-16 address if it's needed.

All helpers above are inlined by verifier.

Also bit unrelated small change - using newly added function
bpf_prog_has_trampoline in check_get_func_ip.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211208193245.172141-5-jolsa@kernel.org
2021-12-13 09:25:59 -08:00
..
alpha futex: Wireup futex_waitv syscall 2021-11-25 14:26:12 +01:00
arc Add linux/cacheflush.h 2021-11-17 10:36:15 -05:00
arm Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
arm64 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
csky asm-generic: asm/syscall.h cleanup 2021-11-10 11:22:03 -08:00
h8300 Kbuild updates for v5.16 2021-11-08 09:15:45 -08:00
hexagon hexagon: ignore vmlinux.lds 2021-11-20 10:35:54 -08:00
ia64 futex: Wireup futex_waitv syscall 2021-11-25 14:26:12 +01:00
m68k asm-generic: syscall table updates 2021-11-25 10:41:28 -08:00
microblaze futex: Wireup futex_waitv syscall 2021-11-25 14:26:12 +01:00
mips Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
nds32 Add linux/cacheflush.h 2021-11-17 10:36:15 -05:00
nios2 Add linux/cacheflush.h 2021-11-17 10:36:15 -05:00
openrisc Merge branch 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2021-11-10 16:15:54 -08:00
parisc parisc: Mark cr16 CPU clocksource unstable on all SMP machines 2021-12-04 21:36:04 +01:00
powerpc Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
riscv Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
s390 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
sh asm-generic: syscall table updates 2021-11-25 10:41:28 -08:00
sparc Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
um ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
x86 bpf: Add get_func_[arg|ret|arg_cnt] helpers 2021-12-13 09:25:59 -08:00
xtensa asm-generic: syscall table updates 2021-11-25 10:41:28 -08:00
.gitignore
Kconfig arch: Add generic Kconfig option indicating page size smaller than 64k 2021-11-27 14:34:41 -08:00