Skip to content

Commit 1117f9c

Browse files
committed
Copy latest files from kernel tree
Signed-off-by: Dave Thaler <[email protected]>
1 parent 458420c commit 1117f9c

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

rst/clang-notes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Arithmetic instructions
2020
For 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+
2329
Atomic operations
2430
=================
2531

rst/instruction-set.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ BPF_JSET 0x40 PC += off if dst & src
253253
BPF_JNE 0x50 PC += off if dst != src
254254
BPF_JSGT 0x60 PC += off if dst > src signed
255255
BPF_JSGE 0x70 PC += off if dst >= src signed
256-
BPF_CALL 0x80 function call
256+
BPF_CALL 0x80 function call see `Helper functions`_
257257
BPF_EXIT 0x90 function / program return BPF_JMP only
258258
BPF_JLT 0xa0 PC += off if dst < src unsigned
259259
BPF_JLE 0xb0 PC += off if dst <= src unsigned
@@ -264,6 +264,13 @@ BPF_JSLE 0xd0 PC += off if dst <= src signed
264264
The eBPF program needs to store the return value into register R0 before doing a
265265
BPF_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

268275
Load and store instructions
269276
===========================

rst/linux-notes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
1523
Legacy BPF Packet access instructions
1624
=====================================
1725

0 commit comments

Comments
 (0)