bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf, docs: Move sentence about returning R0 to abi.rst
@ 2024-05-17 15:34 Dave Thaler
  2024-05-17 15:34 ` [Bpf] " Dave Thaler
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dave Thaler @ 2024-05-17 15:34 UTC (permalink / raw)
  To: bpf; +Cc: bpf, Dave Thaler, 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.

Signed-off-by: Dave Thaler <dthaler1968@googlemail.com>
---
 Documentation/bpf/standardization/abi.rst             | 3 +++
 Documentation/bpf/standardization/instruction-set.rst | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/bpf/standardization/abi.rst b/Documentation/bpf/standardization/abi.rst
index 0c2e10eeb..41514137c 100644
--- a/Documentation/bpf/standardization/abi.rst
+++ b/Documentation/bpf/standardization/abi.rst
@@ -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``.
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index 997560aba..c0d7d74e0 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -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::
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-27  4:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-17 15:34 [PATCH bpf-next] bpf, docs: Move sentence about returning R0 to abi.rst Dave Thaler
2024-05-17 15:34 ` [Bpf] " Dave Thaler
2024-05-25 17:50 ` patchwork-bot+netdevbpf
2024-05-26  9:00 ` [Bpf] " Christoph Hellwig
2024-05-26  9:00   ` [Bpf] " Christoph Hellwig
2024-05-27  4:36 ` [Bpf] " Shung-Hsi Yu
2024-05-27  4:36   ` [Bpf] " Shung-Hsi Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).