BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v4 0/2] bpf: Allow union argument in trampoline based programs
@ 2025-09-19  4:41 Leon Hwang
  2025-09-19  4:41 ` [PATCH bpf-next v4 1/2] " Leon Hwang
  2025-09-19  4:41 ` [PATCH bpf-next v4 2/2] selftests/bpf: Add union argument tests using fexit programs Leon Hwang
  0 siblings, 2 replies; 3+ messages in thread
From: Leon Hwang @ 2025-09-19  4:41 UTC (permalink / raw)
  To: bpf
  Cc: ast, andrii, daniel, martin.lau, eddyz87, song, yonghong.song,
	ameryhung, menglong8.dong, chen.dylane, leon.hwang,
	kernel-patches-bot

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/20250905133226.84675-1-leon.hwang@linux.dev/

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-19  4:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19  4:41 [PATCH bpf-next v4 0/2] bpf: Allow union argument in trampoline based programs Leon Hwang
2025-09-19  4:41 ` [PATCH bpf-next v4 1/2] " Leon Hwang
2025-09-19  4:41 ` [PATCH bpf-next v4 2/2] selftests/bpf: Add union argument tests using fexit programs Leon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox