On Thu, Jul 6, 2023 at 7:32 PM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Thu, Jul 6, 2023 at 3:20 PM Will Hawkins <hawkinsw@xxxxxx> wrote: > > > > The execution of every function proceeds as if it has access to its own > > stack space. > > > > Signed-off-by: Will Hawkins <hawkinsw@xxxxxx> > > --- > > Documentation/bpf/instruction-set.rst | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/Documentation/bpf/instruction-set.rst b/Documentation/bpf/instruction-set.rst > > index 751e657973f0..717259767a41 100644 > > --- a/Documentation/bpf/instruction-set.rst > > +++ b/Documentation/bpf/instruction-set.rst > > @@ -30,6 +30,11 @@ The eBPF calling convention is defined as: > > R0 - R5 are scratch registers and eBPF programs needs to spill/fill them if > > necessary across calls. > > > > +Every function invocation proceeds as if it has exclusive access to an > > +implementation-defined amount of stack space. R10 is a pointer to the byte of > > +memory with the highest address in that stack space. The contents > > +of a function invocation's stack space do not persist between invocations. > > Such description belongs in a future psABI doc. > instruction-set.rst is not a place to describe how registers are used. Thank you for the feedback! How does your comment square with the immediately preceding description in the document that says: R10: read-only frame pointer to access stack (among the description of how other registers are used during function calls). Sorry if I am being dense and/or naive. Sincerely, Will > For example x86-64 JIT maps BPF R10 to RBP. > Yet there is -fomit-frame-pointer. > So we might very well do something like that in the future.