Re: [Bpf] [PATCH 1/1] bpf, docs: Describe stack contents of function calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
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.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux