bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] bpf: Allow union argument in trampoline based programs
@ 2025-09-16 15:52 Leon Hwang
  2025-09-16 15:52 ` [PATCH bpf-next v2 1/3] " Leon Hwang
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Leon Hwang @ 2025-09-16 15:52 UTC (permalink / raw)
  To: bpf
  Cc: ast, andrii, daniel, martin.lau, eddyz87, song, yonghong.song,
	yatsenko, puranjay, davidzalman.101, cheick.traore, chen.dylane,
	mika.westerberg, ameryhung, menglong8.dong, 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:
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 (3):
  bpf: Allow union argument in trampoline based programs
  bpf, x64: Add union argument support in trampoline
  selftests/bpf: Add union argument tests using fexit programs

 arch/x86/net/bpf_jit_comp.c                   |  2 +-
 include/linux/bpf.h                           |  3 ++
 include/linux/btf.h                           |  5 +++
 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 +++++++++++++++++
 7 files changed, 107 insertions(+), 4 deletions(-)

--
2.50.1


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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 15:52 [PATCH bpf-next v2 0/3] bpf: Allow union argument in trampoline based programs Leon Hwang
2025-09-16 15:52 ` [PATCH bpf-next v2 1/3] " Leon Hwang
2025-09-16 21:35   ` Amery Hung
2025-09-17 12:40     ` Leon Hwang
2025-09-17 18:13       ` Alexei Starovoitov
2025-09-18  1:47         ` Leon Hwang
2025-09-16 15:52 ` [PATCH bpf-next v2 2/3] bpf, x64: Add union argument support in trampoline Leon Hwang
2025-09-16 15:52 ` [PATCH bpf-next v2 3/3] selftests/bpf: Add union argument tests using fexit programs Leon Hwang
2025-09-18 16:09   ` Tao Chen
2025-09-19  1:47     ` Leon Hwang
2025-09-19  1:53       ` Alexei Starovoitov
2025-09-19  2:01         ` Leon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).