Re: [PATCH bpf-next v2 3/3] bpf: Use 64-bit return value for bpf_prog_run

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

 



On Mon, Sep 5, 2022 at 12:34 PM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
>
> From: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>
>
> BPF ABI always uses 64-bit return value, but so far __bpf_prog_run and
> higher level wrappers always truncated the return value to 32-bit. We want
> to be able to introduce a new BPF program type that returns a PTR_TO_BTF_ID
> or NULL from the BPF program to the caller context in the kernel. To be
> able to use this returned pointer value, the bpf_prog_run invocation needs
> to be able to return a 64-bit value, so update the definitions to allow
> this.
>
> To avoid code churn in the whole kernel, we let the compiler handle
> truncation normally, and allow new call sites to utilize the 64-bit
> return value, by receiving the return value as a u64.
>
> Reviewed-by: Stanislav Fomichev <sdf@xxxxxxxxxx>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>
> Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>

Acked-by: Song Liu <song@xxxxxxxxxx>




[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