linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/7] bpf: Implement BPF_LINK_UPDATE for tracing links
@ 2025-11-18  0:52 Jordan Rife
  2025-11-18  0:52 ` [RFC PATCH bpf-next 1/7] bpf: Set up update_prog scaffolding for bpf_tracing_link_lops Jordan Rife
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Jordan Rife @ 2025-11-18  0:52 UTC (permalink / raw)
  To: bpf
  Cc: Jordan Rife, linux-arm-kernel, linux-s390, x86,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Puranjay Mohan, Ilya Leoshkevich, Ingo Molnar

Implement update_prog for bpf_tracing_link_lops to enable
BPF_LINK_UPDATE for fentry, fexit, fmod_ret, freplace, etc. links.

My initial motivation for this was to enable a use case where one
process creates and owns links pointing to "hooks" within a tc, xdp, ...
attachment and an external "plugin" loads freplace programs and updates
links to these hooks. Aside from that though, it seemed like it could
be useful to be able to atomically swap out the program associated with
an freplace/fentry/fexit/fmod_ret link more generally.

Implementing program updates for freplace links was fairly
straightforward but proved more difficult for the other link types. The
third patch in this series discusses some other approaches I considered
before settling on the current approach, but I'd appreciate others'
input here to see if there is a better way to implement this that
doesn't require architecture-specific changes.

Thanks!

Jordan

Jordan Rife (7):
  bpf: Set up update_prog scaffolding for bpf_tracing_link_lops
  bpf: Enable BPF_LINK_UPDATE for freplace links
  bpf: Enable BPF_LINK_UPDATE for fentry/fexit/fmod_ret links
  bpf, x86: Make program update work for trampoline ops
  bpf, s390: Make program update work for trampoline ops
  bpf, arm64: Make program update work for trampoline ops
  selftests/bpf: Test BPF_LINK_UPDATE behavior for tracing links

 arch/arm64/net/bpf_jit_comp.c                 |  23 +-
 arch/s390/net/bpf_jit_comp.c                  |  24 +-
 arch/x86/net/bpf_jit_comp.c                   |  17 +-
 include/linux/bpf.h                           |  21 +
 kernel/bpf/syscall.c                          |  68 +++
 kernel/bpf/trampoline.c                       |  75 ++-
 .../bpf/prog_tests/prog_update_tracing.c      | 460 ++++++++++++++++++
 .../selftests/bpf/progs/prog_update_tracing.c | 133 +++++
 8 files changed, 796 insertions(+), 25 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/prog_update_tracing.c
 create mode 100644 tools/testing/selftests/bpf/progs/prog_update_tracing.c

-- 
2.43.0



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

end of thread, other threads:[~2025-11-25 18:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18  0:52 [RFC PATCH bpf-next 0/7] bpf: Implement BPF_LINK_UPDATE for tracing links Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 1/7] bpf: Set up update_prog scaffolding for bpf_tracing_link_lops Jordan Rife
2025-11-18  1:27   ` bot+bpf-ci
2025-11-20 19:23     ` Jordan Rife
2025-11-21 16:34   ` Jiri Olsa
2025-11-25 18:11     ` Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 2/7] bpf: Enable BPF_LINK_UPDATE for freplace links Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 3/7] bpf: Enable BPF_LINK_UPDATE for fentry/fexit/fmod_ret links Jordan Rife
2025-11-18  1:19   ` bot+bpf-ci
2025-11-20 19:23     ` Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 4/7] bpf, x86: Make program update work for trampoline ops Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 5/7] bpf, s390: " Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 6/7] bpf, arm64: " Jordan Rife
2025-11-18  0:52 ` [RFC PATCH bpf-next 7/7] selftests/bpf: Test BPF_LINK_UPDATE behavior for tracing links Jordan Rife
2025-11-22  1:43 ` [RFC PATCH bpf-next 0/7] bpf: Implement BPF_LINK_UPDATE " Alexei Starovoitov
2025-11-25 18:10   ` Jordan Rife

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).