Re: [PATCH bpf-next v1 0/4] Support bpf trampoline for RV64

From: Pu Lehui
Date: Wed Feb 15 2023 - 20:27:51 EST




On 2023/2/15 22:45, Björn Töpel wrote:
Hi Lehui,

Pu Lehui <pulehui@xxxxxxxxxxxxxxx> writes:

BPF trampoline is the critical infrastructure of the bpf
subsystem, acting as a mediator between kernel functions
and BPF programs. Numerous important features, such as
using ebpf program for zero overhead kernel introspection,
rely on this key component. We can't wait to support bpf
trampoline on RV64. Since RV64 does not support ftrace
direct call yet, the current RV64 bpf trampoline is only
used in bpf context.

Thanks a lot for continuing this work. I agree with you that it's
valuable to have BPF trampoline support, even without proper direct call
support (we'll get there soon). The trampoline enables kfunc calls. On
that note; I don't see that you enable "bpf_jit_supports_kfunc_call()"
anywhere in the series. With BPF trampoline support, the RISC-V BPF
finally can support kfunc calls!

I'd add the following to bpf_jit_comp64.c:


happy to hear that,let's make it more completeable.

bool bpf_jit_supports_kfunc_call(void)
{
return true;
}

:-)

I'll do a review ASAP.


Björn