BPF static branches
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest9 patches 22 repliesIn review
Changes in v1 from the cover letter
- converted to v1 based on the feedback (there was none)
- bpftool support was added to dump new instructions
- self-tests were added
- minor fixes & checkpatch warnings
[1] https://lpc.events/event/17/contributions/1608/attachments/1278/2578/bpf-static-keys.pdf
[2] https://lore.kernel.org/bpf/[email protected]/
[3] https://github.com/llvm/llvm-project/pull/75110
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | bpf: fix potential error returnkernel/ | +8 | 0 replies | |
| 2/9 | bpf: keep track of and expose xlated insn offsetsinclude/ include/ include/ +4 more | +67 | 0 replies | |
| 3/9 | bpf: expose how xlated insns map to jitted insnsarch/ include/ include/ +4 more | +93 | 20 replies | |
| 4/9 | selftests/bpf: Add tests for instructions mappingstools/ tools/ | +311 | 0 replies | |
| 5/9 | bpftool: dump new fields of bpf prog infotools/ tools/ tools/ | +34 | 0 replies | |
| 6/9 | bpf: add support for an extended JA instructionarch/ include/ kernel/ +1 more | +71 | 0 replies | |
| 7/9 | bpf: Add kernel/bpftool asm support for new instructionskernel/ | +27 | 0 replies | |
| 8/9 | bpf: add BPF_STATIC_BRANCH_UPDATE syscallarch/ include/ include/ +4 more | +122 | 0 replies | |
| 9/9 | selftests/bpf: Add tests for new ja* instructionstools/ | +269 | 0 replies |
Reviews trailers per patch
1 of 9 patches has a Reviewed-by or Acked-by.
| Patch | Jiri Olsa |
|---|---|
| 1/9 | A-b |
| 2/9 | |
| 3/9 | |
| 4/9 | |
| 5/9 | |
| 6/9 | |
| 7/9 | |
| 8/9 | |
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 bpf-next 0/9] BPF static branches
This series adds support for mapping between xlated and original instructions offsets, mapping between xlated and jitted instructions offsets (x86), support for two new BPF instruction JA[SRC=1] (goto[l]_or_nop) and JA[SRC=3] (nop_or_goto[l]), and a new syscall to configure the jitted values of such instructions.
This a follow up to the previous attempt to add static keys support (see [1], [2]) which implements lower-level functionality than what was proposed before.
The first patch .
The second patch adds xlated -> original mapping.
The third patch adds .
The fourth patch adds support for new instructions. And the fifth patch adds support for new syscall.
The following patches are included:
Patch 1 is a formal bug fix
Patch 2 adds the xlated -> original mapping
Patch 3 adds the xlated -> jitted mapping
Patch 4 adds tests for instructions mappings
Patch 5 adds bpftool support for printing new instructions Patch 6 add support for an extended JA instruction
Patch 7 add support for kernel/bpftool to display new instructions Patch 8 adds a new BPF_STATIC_BRANCH_UPDATE syscall Patch 9 adds tests for the new ja* instructions and the new syscall
Altogether this provides enough functionality to dynamically patch programs and support simple static keys.
rfc -> v1:
- converted to v1 based on the feedback (there was none)
- bpftool support was added to dump new instructions
- self-tests were added
- minor fixes & checkpatch warnings
[1] https://lpc.events/event/17/contributions/1608/attachments/1278/2578/bpf-static-keys.pdf
[2] https://lore.kernel.org/bpf/[email protected]/
[3] https://github.com/llvm/llvm-project/pull/75110
Anton Protopopov (9):
bpf: fix potential error return
bpf: keep track of and expose xlated insn offsets
bpf: expose how xlated insns map to jitted insns selftests/bpf: Add tests for instructions mappings
bpftool: dump new fields of bpf prog info
bpf: add support for an extended JA instruction
bpf: Add kernel/bpftool asm support for new instructions
bpf: add BPF_STATIC_BRANCH_UPDATE syscall selftests/bpf: Add tests for new ja* instructions
arch/x86/net/bpf_jit_comp.c | 73 ++++- include/linux/bpf.h | 11 + include/linux/bpf_verifier.h | 1 - include/linux/filter.h | 1 + include/uapi/linux/bpf.h | 26 ++ kernel/bpf/core.c | 67 ++++- kernel/bpf/disasm.c | 33 ++- kernel/bpf/syscall.c | 115 ++++++++ kernel/bpf/verifier.c | 58 +++- tools/bpf/bpftool/prog.c | 14 + tools/bpf/bpftool/xlated_dumper.c | 18 ++ tools/bpf/bpftool/xlated_dumper.h | 2 + tools/include/uapi/linux/bpf.h | 26 ++ .../bpf/prog_tests/bpf_insns_mappings.c | 156 ++++++++++ .../bpf/prog_tests/bpf_static_branches.c | 269 ++++++++++++++++++ .../selftests/bpf/progs/bpf_insns_mappings.c | 155 ++++++++++ 16 files changed, 1002 insertions(+), 23 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_insns_mappings.c create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_static_branches.c create mode 100644 tools/testing/selftests/bpf/progs/bpf_insns_mappings.c
Signature · 1 line
2.34.1