]> Git Repo - J-linux.git/commitdiff
bpf, docs: Clarify PC use in instruction-set.rst
authorDave Thaler <[email protected]>
Fri, 26 Apr 2024 23:11:26 +0000 (16:11 -0700)
committerDaniel Borkmann <[email protected]>
Mon, 29 Apr 2024 09:54:42 +0000 (11:54 +0200)
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]
Documentation/bpf/standardization/instruction-set.rst

index b44bdacd0195782d8e9170243404e629907a7ada..997560abadabea75e81014fbd9ca554b8686ba53 100644 (file)
@@ -469,6 +469,12 @@ JSLT      0xc    any      PC += offset if dst < src          signed
 JSLE      0xd    any      PC += offset if dst <= src         signed
 ========  =====  =======  =================================  ===================================================
 
+where 'PC' denotes the program counter, and the offset to increment by
+is in units of 64-bit instructions relative to the instruction following
+the jump instruction.  Thus 'PC += 1' skips execution of the next
+instruction if it's a basic instruction or results in undefined behavior
+if the next instruction is a 128-bit wide instruction.
+
 The BPF program needs to store the return value into register R0 before doing an
 ``EXIT``.
 
This page took 0.049759 seconds and 4 git commands to generate.