summaryrefslogtreecommitdiffstats
path: root/Documentation/bpf
diff options
context:
space:
mode:
authorDave Thaler <dthaler1968@googlemail.com>2024-04-26 16:11:26 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2024-04-29 11:54:42 +0200
commit07801a24e2f18624cd2400ce15f14569eb416c9a (patch)
tree19e50ffbf18843caa1fee3e790f8a3b28ac5354d /Documentation/bpf
parent6e25bcf06af0341691f7058e17e04800f6a19e26 (diff)
downloadlinux-07801a24e2f18624cd2400ce15f14569eb416c9a.tar.gz
linux-07801a24e2f18624cd2400ce15f14569eb416c9a.tar.bz2
linux-07801a24e2f18624cd2400ce15f14569eb416c9a.zip
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 <dthaler1968@googlemail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: David Vernet <void@manifault.com> Link: https://lore.kernel.org/bpf/20240426231126.5130-1-dthaler1968@gmail.com
Diffstat (limited to 'Documentation/bpf')
-rw-r--r--Documentation/bpf/standardization/instruction-set.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index b44bdacd0195..997560abadab 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -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``.