Skip to content

bpf: Allow union argument in trampoline based programs

Leon Hwang bpf 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 0 repliesNew
  2. v32 patches 1 replySuperseded
  3. v23 patches 8 repliesSuperseded

Changes in v4 from the cover letter

* Address comments from Alexei:
* Trim bpftrace output in patch #1 log.
* Drop the referenced commit info and the test output in patch #2 log.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: Allow union argument in trampoline based programsinclude/linux/bpf.h kernel/bpf/btf.c+5 -50 replies
2/2selftests/bpf: Add union argument tests using fexit programstools/testing/selftests/bpf/prog_tests/tracing_struct.c tools/testing/selftests/bpf/progs/tracing_struct.c tools/testing/selftests/bpf/test_kmods/bpf_testmod.c+93 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAmery Hung
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH bpf-next v4 0/2] bpf: Allow union argument in trampoline based programs

While tracing 'release_pages' with bpfsnoop[0], the verifier reports:

The function release_pages arg0 type UNION is unsupported.

However, it should be acceptable to trace functions that have 'union' arguments.

This patch set enables such support in the verifier by allowing 'union' as a valid argument type.

Changes:
v3 -> v4:
* Address comments from Alexei:
* Trim bpftrace output in patch #1 log.
* Drop the referenced commit info and the test output in patch #2 log.

v2 -> v3:
* Address comments from Alexei:
* Reuse the existing flag BTF_FMODEL_STRUCT_ARG.
* Update the comment of the flag BTF_FMODEL_STRUCT_ARG.

v1 -> v2:
* Add 16B 'union' argument support in x86_64 trampoline.
* Update selftests using bpf_testmod.
* Add test case about 16-bytes 'union' argument.
* Address comments from Alexei:
* Study the patch set about 'struct' argument support.
* Update selftests to cover more cases.
v1: https://lore.kernel.org/bpf/[email protected]/

Links:
[0] https://github.com/bpfsnoop/bpfsnoop

Leon Hwang (2):
bpf: Allow union argument in trampoline based programs selftests/bpf: Add union argument tests using fexit programs

 include/linux/bpf.h                           |  2 +-
 kernel/bpf/btf.c                              |  8 ++---
 .../selftests/bpf/prog_tests/tracing_struct.c | 29 ++++++++++++++++
 .../selftests/bpf/progs/tracing_struct.c      | 33 +++++++++++++++++++
 .../selftests/bpf/test_kmods/bpf_testmod.c    | 31 +++++++++++++++++
 5 files changed, 98 insertions(+), 5 deletions(-)

--
2.51.0