[PATCH v3 bpf-next 0/2] bpf: Allow some trace helpers for all prog types

Feng Yang posted 2 patches 7 months, 2 weeks ago
include/linux/bpf-cgroup.h |  8 --------
kernel/bpf/cgroup.c        | 32 -----------------------------
kernel/bpf/helpers.c       | 42 ++++++++++++++++++++++++++++++++++++++
kernel/sched/ext.c         | 15 +-------------
kernel/trace/bpf_trace.c   | 41 ++++---------------------------------
net/core/filter.c          | 14 -------------
6 files changed, 47 insertions(+), 105 deletions(-)
[PATCH v3 bpf-next 0/2] bpf: Allow some trace helpers for all prog types
Posted by Feng Yang 7 months, 2 weeks ago
From: Feng Yang <yangfeng@kylinos.cn>

This series allow some trace helpers for all prog types.

if it works under NMI and doesn't use any context-dependent things,
should be fine for any program type. The detailed discussion is in [1].

[1] https://lore.kernel.org/all/CAEf4Bza6gK3dsrTosk6k3oZgtHesNDSrDd8sdeQ-GiS6oJixQg@mail.gmail.com/

---
Changes in v3:
- cgroup_current_func_proto clean.
- bpf_scx_get_func_proto clean. Thanks, Andrii Nakryiko.
- Link to v2: https://lore.kernel.org/all/20250427063821.207263-1-yangfeng59949@163.com/

Changes in v2:
- not expose compat probe read APIs to more program types.
- Remove the prog->sleepable check added for copy_from_user,
- or the summarization_freplace/might_sleep_with_might_sleep test will fail with the error "program of this type cannot use helper bpf_copy_from_user"
- Link to v1: https://lore.kernel.org/all/20250425080032.327477-1-yangfeng59949@163.com/

Feng Yang (2):
  bpf: Allow some trace helpers for all prog types
  sched_ext: Remove bpf_scx_get_func_proto

 include/linux/bpf-cgroup.h |  8 --------
 kernel/bpf/cgroup.c        | 32 -----------------------------
 kernel/bpf/helpers.c       | 42 ++++++++++++++++++++++++++++++++++++++
 kernel/sched/ext.c         | 15 +-------------
 kernel/trace/bpf_trace.c   | 41 ++++---------------------------------
 net/core/filter.c          | 14 -------------
 6 files changed, 47 insertions(+), 105 deletions(-)

-- 
2.43.0