Skip to content

Commit 07801a2

Browse files
Dave Thalerborkmann
Dave Thaler
authored andcommitted
bpf, docs: Clarify PC use in instruction-set.rst
This patch elaborates on the use of PC by expanding the PC acronym, explaining the units, and the relative position to which the offset applies. Signed-off-by: Dave Thaler <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: David Vernet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 6e25bcf commit 07801a2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Documentation/bpf/standardization/instruction-set.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,12 @@ JSLT 0xc any PC += offset if dst < src signed
469469
JSLE 0xd any PC += offset if dst <= src signed
470470
======== ===== ======= ================================= ===================================================
471471

472+
where 'PC' denotes the program counter, and the offset to increment by
473+
is in units of 64-bit instructions relative to the instruction following
474+
the jump instruction. Thus 'PC += 1' skips execution of the next
475+
instruction if it's a basic instruction or results in undefined behavior
476+
if the next instruction is a 128-bit wide instruction.
477+
472478
The BPF program needs to store the return value into register R0 before doing an
473479
``EXIT``.
474480

0 commit comments

Comments
 (0)