summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Hawkins <hawkinsw@obs.cr>2023-08-26 08:32:54 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2023-08-30 10:49:53 +0300
commit2d71a90f7e0fa3cd348602a36f6eb1237ab7cebb (patch)
tree6be4f228ed36d9cecdc7981ed606d4b6c7fa7cb9
parent5439cfa7fe612e7d02d5a1234feda3fa6e483ba7 (diff)
downloadlinux-2d71a90f7e0fa3cd348602a36f6eb1237ab7cebb.tar.xz
bpf, docs: Correct source of offset for program-local call
The offset to use when calculating the target of a program-local call is in the instruction's imm field, not its offset field. Signed-off-by: Will Hawkins <hawkinsw@obs.cr> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Acked-by: David Vernet <void@manifault.com> Link: https://lore.kernel.org/bpf/20230826053258.1860167-1-hawkinsw@obs.cr
-rw-r--r--Documentation/bpf/standardization/instruction-set.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index 4f73e9dc8d9e..c5b0b2011f16 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -373,7 +373,7 @@ BPF_JNE 0x5 any PC += offset if dst != src
BPF_JSGT 0x6 any PC += offset if dst > src signed
BPF_JSGE 0x7 any PC += offset if dst >= src signed
BPF_CALL 0x8 0x0 call helper function by address see `Helper functions`_
-BPF_CALL 0x8 0x1 call PC += offset see `Program-local functions`_
+BPF_CALL 0x8 0x1 call PC += imm see `Program-local functions`_
BPF_CALL 0x8 0x2 call helper function by BTF ID see `Helper functions`_
BPF_EXIT 0x9 0x0 return BPF_JMP only
BPF_JLT 0xa any PC += offset if dst < src unsigned
@@ -424,8 +424,8 @@ Program-local functions
~~~~~~~~~~~~~~~~~~~~~~~
Program-local functions are functions exposed by the same BPF program as the
caller, and are referenced by offset from the call instruction, similar to
-``BPF_JA``. A ``BPF_EXIT`` within the program-local function will return to
-the caller.
+``BPF_JA``. The offset is encoded in the imm field of the call instruction.
+A ``BPF_EXIT`` within the program-local function will return to the caller.
Load and store instructions
===========================