linux-stable/arch/x86
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
..
boot - Do not #GP on userspace use of CLI/STI but pretend it was a NOP to 2021-11-02 07:56:47 -07:00
configs configs: remove the obsolete CONFIG_INPUT_POLLDEV 2021-09-08 11:50:28 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-11-01 21:24:02 -07:00
entry x86/xen: Add xenpv_restore_regs_and_return_to_usermode() 2021-12-03 19:21:15 +01:00
events x86/perf: Fix snapshot_branch_stack warning in VM 2021-11-17 14:48:43 +01:00
hyperv x86/hyperv: Move required MSRs check to initial platform probing 2021-11-15 12:37:08 +00:00
ia32 audit/stable-5.16 PR 20211101 2021-11-01 21:17:39 -07:00
include - Fix a couple of SWAPGS fencing issues in the x86 entry code 2021-12-05 08:43:35 -08:00
kernel x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword 2021-12-03 18:09:30 +01:00
kvm KVM: SVM: Do not terminate SEV-ES guests on GHCB validation failure 2021-12-05 03:02:04 -05:00
lib - Do not #GP on userspace use of CLI/STI but pretend it was a NOP to 2021-11-02 07:56:47 -07:00
math-emu x86/math-emu: Convert to fpstate 2021-10-20 23:57:54 +02:00
mm Merge branch 'kvm-guest-sev-migration' into kvm-master 2021-11-11 07:40:26 -05:00
net bpf: Add get_func_[arg|ret|arg_cnt] helpers 2021-12-13 09:25:59 -08:00
pci xen: branch for v5.16-rc1 2021-11-10 11:14:21 -08:00
platform x86/sme: Explicitly map new EFI memmap table as encrypted 2021-12-05 16:44:52 +01:00
power x86/fpu: Replace the includes of fpu/internal.h 2021-10-20 15:27:29 +02:00
purgatory
ras
realmode x86/64/mm: Map all kernel memory into trampoline_pgd 2021-12-03 09:11:43 +01:00
tools Driver core changes for 5.16-rc1 2021-11-04 08:32:38 -07:00
um um: fix stub location calculation 2021-08-26 22:28:03 +02:00
video
xen x86/xen: Add xenpv_restore_regs_and_return_to_usermode() 2021-12-03 19:21:15 +01:00
.gitignore
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig EFI fix for v5.16 2021-12-06 10:09:00 -08:00
Kconfig.assembler
Kconfig.cpu x86/CPU: Add support for Vortex CPUs 2021-10-21 15:49:07 +02:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile Kbuild updates for v5.16 2021-11-08 09:15:45 -08:00
Makefile.um
Makefile_32.cpu x86/build: Do not add -falign flags unconditionally for clang 2021-09-19 10:35:53 +09:00