BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/7] BPF Static Keys
@ 2023-12-06 14:10 Anton Protopopov
  2023-12-06 14:10 ` [PATCH bpf-next 1/7] bpf: extract bpf_prog_bind_map logic into an inline helper Anton Protopopov
                   ` (6 more replies)
  0 siblings, 7 replies; 32+ messages in thread
From: Anton Protopopov @ 2023-12-06 14:10 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Jiri Olsa,
	Martin KaFai Lau, Stanislav Fomichev, bpf
  Cc: Anton Protopopov

This patch series adds new BPF Static Keys API and implements it for X86.

The first three patches are preparatory to make main changes simpler. 

The fourth patch adds kernel API which allows to pass a list of "static
branches" to kernel. A static branch is JA instruction which can be patched
runtime by setting controlling map, aka static key, value to zero/non-zero.

The fifth patch adds arch support for static keys on x86.

The sixth patch adds libbpf support for static keys, which is more
user-friendly than just passing a list of branches.

Finally, the seventh patch adds some self-tests.

See the Plumbers talk [1] for more details on the design.

Anton Protopopov (7):
  bpf: extract bpf_prog_bind_map logic into an inline helper
  bpf: rename and export a struct definition
  bpf: adjust functions offsets when patching progs
  bpf: implement BPF Static Keys support
  bpf: x86: implement static keys support
  libbpf: BPF Static Keys support
  selftests/bpf: Add tests for BPF Static Keys

 MAINTAINERS                                   |   7 +
 arch/x86/net/bpf_jit_comp.c                   |  72 +++
 include/linux/bpf.h                           |  34 ++
 include/uapi/linux/bpf.h                      |  18 +
 kernel/bpf/Makefile                           |   2 +
 kernel/bpf/arraymap.c                         |  15 +-
 kernel/bpf/core.c                             |   9 +
 kernel/bpf/skey.c                             | 306 ++++++++++++
 kernel/bpf/syscall.c                          | 100 ++--
 kernel/bpf/verifier.c                         | 103 ++++-
 tools/include/uapi/linux/bpf.h                |  18 +
 tools/lib/bpf/bpf.c                           |   5 +-
 tools/lib/bpf/bpf.h                           |   4 +-
 tools/lib/bpf/bpf_helpers.h                   |  64 +++
 tools/lib/bpf/libbpf.c                        | 273 ++++++++++-
 tools/lib/bpf/libbpf_internal.h               |   3 +
 tools/lib/bpf/linker.c                        |   8 +-
 .../bpf/prog_tests/bpf_static_keys.c          | 436 ++++++++++++++++++
 .../selftests/bpf/progs/bpf_static_keys.c     | 120 +++++
 19 files changed, 1542 insertions(+), 55 deletions(-)
 create mode 100644 kernel/bpf/skey.c
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_static_keys.c
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_static_keys.c

-- 
2.34.1


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

end of thread, other threads:[~2023-12-14 16:56 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-06 14:10 [PATCH bpf-next 0/7] BPF Static Keys Anton Protopopov
2023-12-06 14:10 ` [PATCH bpf-next 1/7] bpf: extract bpf_prog_bind_map logic into an inline helper Anton Protopopov
2023-12-06 14:10 ` [PATCH bpf-next 2/7] bpf: rename and export a struct definition Anton Protopopov
2023-12-06 14:10 ` [PATCH bpf-next 3/7] bpf: adjust functions offsets when patching progs Anton Protopopov
2023-12-06 14:10 ` [PATCH bpf-next 4/7] bpf: implement BPF Static Keys support Anton Protopopov
2023-12-06 14:10 ` [PATCH bpf-next 5/7] bpf: x86: implement static keys support Anton Protopopov
2023-12-06 14:10 ` [PATCH bpf-next 6/7] libbpf: BPF Static Keys support Anton Protopopov
2023-12-08  3:45   ` Alexei Starovoitov
2023-12-08 16:19     ` Anton Protopopov
2023-12-08 22:04       ` Andrii Nakryiko
2023-12-08 23:07         ` Eduard Zingerman
2023-12-09  4:07           ` Alexei Starovoitov
2023-12-09  4:05         ` Alexei Starovoitov
2023-12-09  4:15           ` Yonghong Song
2023-12-09  4:25             ` Alexei Starovoitov
2023-12-09  5:04               ` Yonghong Song
2023-12-09 17:18                 ` Alexei Starovoitov
2023-12-10  6:32                   ` Yonghong Song
2023-12-10 10:30                     ` Eduard Zingerman
2023-12-11  3:33                       ` Alexei Starovoitov
2023-12-11 18:49                         ` Andrii Nakryiko
2023-12-12 10:25                         ` Anton Protopopov
2023-12-14  2:15                           ` Alexei Starovoitov
2023-12-14  3:04                             ` Yonghong Song
2023-12-14 16:56                               ` Eduard Zingerman
2023-12-14 16:33                             ` Anton Protopopov
2023-12-11 17:31                     ` Anton Protopopov
2023-12-11 19:08                       ` Alexei Starovoitov
2023-12-12  9:06                         ` Anton Protopopov
2023-12-11 21:51                       ` Yonghong Song
2023-12-11 22:52                         ` Yonghong Song
2023-12-06 14:10 ` [PATCH bpf-next 7/7] selftests/bpf: Add tests for BPF Static Keys Anton Protopopov

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