All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next RFC v1 0/8] Support kernel module function calls from eBPF
@ 2021-08-30 17:34 Kumar Kartikeya Dwivedi
  2021-08-30 17:34 ` [PATCH bpf-next RFC v1 1/8] bpf: Introduce BPF support for kernel module function calls Kumar Kartikeya Dwivedi
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2021-08-30 17:34 UTC (permalink / raw)
  To: bpf
  Cc: Kumar Kartikeya Dwivedi, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	Jesper Dangaard Brouer, Toke Høiland-Jørgensen, netdev

This set enables kernel module function calls, and also modifies verifier logic
to permit invalid kernel function calls as long as they are pruned as part of
dead code elimination. This is done to provide better runtime portability for
BPF objects, which can conditionally disable parts of code that are pruned later
by the verifier (e.g. const volatile vars, kconfig options). libbpf
modifications are made along with kernel changes to support module function
calls.

It also converts TCP congestion control objects to use the module kfunc support
instead of relying on IS_BUILTIN ifdef.

Kumar Kartikeya Dwivedi (8):
  bpf: Introduce BPF support for kernel module function calls
  bpf: Be conservative during verification for invalid kfunc calls
  libbpf: Support kernel module function calls
  libbpf: Resolve invalid kfunc calls with imm = 0, off = 0
  tools: Allow specifying base BTF file in resolve_btfids
  bpf: btf: Introduce helpers for dynamic BTF set registration
  bpf: enable TCP congestion control kfunc from modules
  bpf, selftests: Add basic test for module kfunc call

 include/linux/bpf.h                           |   1 +
 include/linux/bpfptr.h                        |   1 +
 include/linux/btf.h                           |  18 +++
 include/linux/filter.h                        |   9 ++
 include/uapi/linux/bpf.h                      |   3 +-
 kernel/bpf/btf.c                              |  37 +++++++
 kernel/bpf/core.c                             |  14 +++
 kernel/bpf/syscall.c                          |  55 +++++++++-
 kernel/bpf/verifier.c                         | 103 ++++++++++++++----
 kernel/trace/bpf_trace.c                      |   1 +
 net/ipv4/bpf_tcp_ca.c                         |  34 +-----
 net/ipv4/tcp_bbr.c                            |  28 ++++-
 net/ipv4/tcp_cubic.c                          |  26 ++++-
 net/ipv4/tcp_dctcp.c                          |  26 ++++-
 scripts/Makefile.modfinal                     |   1 +
 tools/bpf/resolve_btfids/main.c               |  19 +++-
 tools/include/uapi/linux/bpf.h                |   3 +-
 tools/lib/bpf/bpf.c                           |   3 +
 tools/lib/bpf/libbpf.c                        |  91 ++++++++++++++--
 tools/lib/bpf/libbpf_internal.h               |   2 +
 tools/testing/selftests/bpf/Makefile          |   3 +-
 .../selftests/bpf/bpf_testmod/bpf_testmod.c   |  23 +++-
 .../selftests/bpf/prog_tests/ksyms_module.c   |  10 +-
 .../selftests/bpf/progs/test_ksyms_module.c   |   9 ++
 24 files changed, 446 insertions(+), 74 deletions(-)

-- 
2.33.0


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

end of thread, other threads:[~2021-09-01  3:38 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 17:34 [PATCH bpf-next RFC v1 0/8] Support kernel module function calls from eBPF Kumar Kartikeya Dwivedi
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 1/8] bpf: Introduce BPF support for kernel module function calls Kumar Kartikeya Dwivedi
2021-08-30 20:01   ` Alexei Starovoitov
2021-08-30 20:03   ` kernel test robot
2021-08-30 22:19   ` kernel test robot
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 2/8] bpf: Be conservative during verification for invalid kfunc calls Kumar Kartikeya Dwivedi
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 3/8] libbpf: Support kernel module function calls Kumar Kartikeya Dwivedi
2021-09-01  0:55   ` Andrii Nakryiko
2021-09-01  2:27     ` Kumar Kartikeya Dwivedi
2021-09-01  2:59       ` Alexei Starovoitov
2021-09-01  3:38         ` Andrii Nakryiko
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 4/8] libbpf: Resolve invalid kfunc calls with imm = 0, off = 0 Kumar Kartikeya Dwivedi
2021-09-01  0:35   ` Andrii Nakryiko
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 5/8] tools: Allow specifying base BTF file in resolve_btfids Kumar Kartikeya Dwivedi
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 6/8] bpf: btf: Introduce helpers for dynamic BTF set registration Kumar Kartikeya Dwivedi
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 7/8] bpf: enable TCP congestion control kfunc from modules Kumar Kartikeya Dwivedi
2021-08-31  0:16   ` kernel test robot
2021-09-01  0:48   ` Andrii Nakryiko
2021-08-30 17:34 ` [PATCH bpf-next RFC v1 8/8] bpf, selftests: Add basic test for module kfunc call Kumar Kartikeya Dwivedi
2021-08-30 20:07   ` Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.