Skip to content

Commit a456e6b

Browse files
committed
Add note about multiple input registers
Allowed if defined by the program type, and note that all program types on Linux use just one register as input. Signed-off-by: Dave Thaler <[email protected]>
1 parent 271ca70 commit a456e6b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

isa/kernel.org/instruction-set.rst

+8-6
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ The reason for spilling/filling is due to the limited number of registers.
4040
*Linux implementation note*: In the Linux kernel, the exit value for eBPF
4141
programs is passed as a 32 bit value.
4242

43-
Upon entering execution of an eBPF program, register R1 initially contains
44-
the context for the program. The context is the input argument for the program
45-
(similar to argc/argv pair for a typical C program). Since only one register
46-
is used for the context, the context is typically a structure containing all
47-
the inputs needed. The context is defined by the program type; for example,
48-
a networking program might have a context that includes network packet data
43+
Upon entering execution of an eBPF program, registers R1 - R5 initially can contain
44+
the input arguments for the program (similar to the argc/argv pair for a typical C program).
45+
The actual number of registers used, and their meaning, is defined by the program type;
46+
for example, a networking program might have an argument that includes network packet data
4947
and/or metadata.
5048

49+
*Linux implementation note*: In the Linux kernel, all program types only use
50+
R1 which contains the "context", which is typically a structure containing all
51+
the inputs needed.
52+
5153
Instruction encoding
5254
====================
5355

0 commit comments

Comments
 (0)