File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ Arithmetic instructions
2020For CPU versions prior to 3, Clang v7.0 and later can enable ``BPF_ALU `` support with
2121``-Xclang -target-feature -Xclang +alu32 ``. In CPU version 3, support is automatically included.
2222
23+ Jump instructions
24+ =================
25+
26+ If ``-O0 `` is used, Clang will generate the ``BPF_CALL | BPF_X | BPF_JMP `` (0x8d)
27+ instruction, which is not supported by the Linux kernel verifier.
28+
2329Atomic operations
2430=================
2531
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ BPF_JSET 0x40 PC += off if dst & src
253253BPF_JNE 0x50 PC += off if dst != src
254254BPF_JSGT 0x60 PC += off if dst > src signed
255255BPF_JSGE 0x70 PC += off if dst >= src signed
256- BPF_CALL 0x80 function call
256+ BPF_CALL 0x80 function call see ` Helper functions `_
257257BPF_EXIT 0x90 function / program return BPF_JMP only
258258BPF_JLT 0xa0 PC += off if dst < src unsigned
259259BPF_JLE 0xb0 PC += off if dst <= src unsigned
@@ -264,6 +264,13 @@ BPF_JSLE 0xd0 PC += off if dst <= src signed
264264The eBPF program needs to store the return value into register R0 before doing a
265265BPF_EXIT.
266266
267+ Helper functions
268+ ~~~~~~~~~~~~~~~~
269+
270+ Helper functions are a concept whereby BPF programs can call into a
271+ set of function calls exposed by the runtime. Each helper
272+ function is identified by an integer used in a ``BPF_CALL `` instruction.
273+ The available helper functions may differ for each program type.
267274
268275Load and store instructions
269276===========================
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ Byte swap instructions
1212
1313``BPF_FROM_LE `` and ``BPF_FROM_BE `` exist as aliases for ``BPF_TO_LE `` and ``BPF_TO_BE `` respectively.
1414
15+ Jump instructions
16+ =================
17+
18+ ``BPF_CALL | BPF_X | BPF_JMP `` (0x8d), where the helper function
19+ integer would be read from a specified register, is not currently supported
20+ by the verifier. Any programs with this instruction will fail to load
21+ until such support is added.
22+
1523Legacy BPF Packet access instructions
1624=====================================
1725
You can’t perform that action at this time.
0 commit comments