Skip to contentSkip to conversation

bpf, docs: Move sentence about returning R0 to abi.rst

PATCH Applied Dave Thaler 4 participants 4 messages May 17, 2024 – May 27, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf, docs: Move sentence about returning R0 to abi.rst

As discussed at LSF/MM/BPF, the sentence about using R0 for returning values from calls is part of the calling convention and belongs in abi.rst. Any further additions or clarifications to this text are left for future patches on abi.rst. The current patch is simply to unblock progression of instruction-set.rst to a standard.

In contrast, the restriction of register numbers to the range 0-10 is untouched, left in the instruction-set.rst definition of the src_reg and dst_reg fields.

---
 Documentation/bpf/standardization/abi.rst             | 3 +++
 Documentation/bpf/standardization/instruction-set.rst | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/bpf/standardization/abi.rst +3 -0
index 0c2e10eeb..41514137c 100644
@@ -23,3 +23,6 @@ The BPF calling convention is defined as:
 
 R0 - R5 are scratch registers and BPF programs needs to spill/fill them if
 necessary across calls.
+
+The BPF program needs to store the return value into register R0 before doing an
+``EXIT``.
Documentation/bpf/standardization/instruction-set.rst +0 -3
index 997560aba..c0d7d74e0 100644
@@ -475,9 +475,6 @@ 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``.
-
 Example:
 
 ``{JSGE, X, JMP32}`` means::
Signature · 1 line
2.40.1
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 11 lines · On Fri, 17 May 2024 08:34:45 -0700 you wrote:

As discussed at LSF/MM/BPF, the sentence about using R0 for returning values from calls is part of the calling convention and belongs in abi.rst. Any further additions or clarifications to this text are left for future patches on abi.rst. The current patch is simply to unblock progression of instruction-set.rst to a standard.

In contrast, the restriction of register numbers to the range 0-10 is untouched, left in the instruction-set.rst definition of the src_reg and dst_reg fields.

[...]

Here is the summary with links:
- [bpf-next] bpf, docs: Move sentence about returning R0 to abi.rst

    https://git.kernel.org/bpf/bpf-next/c/4652072e7b9d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Acked-by on v1 1/1
#3 lore raw
In reply to Dave Thaler
Quoted 11 lines · Dave Thaler

As discussed at LSF/MM/BPF, the sentence about using R0 for returning values from calls is part of the calling convention and belongs in abi.rst. Any further additions or clarifications to this text are left for future patches on abi.rst. The current patch is simply to unblock progression of instruction-set.rst to a standard.

In contrast, the restriction of register numbers to the range 0-10 is untouched, left in the instruction-set.rst definition of the src_reg and dst_reg fields.