[PATCH v2] riscv, bpf: Adapt bpf trampoline to optimized riscv ftrace framework
Björn Töpel
bjorn at kernel.org
Fri Jul 21 13:42:12 PDT 2023
Pu Lehui <pulehui at huaweicloud.com> writes:
> From: Pu Lehui <pulehui at huawei.com>
>
> Commit 6724a76cff85 ("riscv: ftrace: Reduce the detour code size to
> half") optimizes the detour code size of kernel functions to half with
> T0 register and the upcoming DYNAMIC_FTRACE_WITH_DIRECT_CALLS of riscv
> is based on this optimization, we need to adapt riscv bpf trampoline
> based on this. One thing to do is to reduce detour code size of bpf
> programs, and the second is to deal with the return address after the
> execution of bpf trampoline. Meanwhile, we need to construct the frame
> of parent function, otherwise we will miss one layer when unwinding.
> The related tests have passed.
>
> Signed-off-by: Pu Lehui <pulehui at huawei.com>
I'll do a proper review later (still on vacation), but I ran the
test_progs BPF selftest with the ftrace series [1] with this patch on
top.
81 more tests pass with [1] plus this patch, which is great!
Pre-patches [2], post-patches [3].
Feel free to add:
Tested-by: Björn Töpel <bjorn at rivosinc.com>
Björn
[1] https://lore.kernel.org/linux-riscv/20230627111612.761164-1-suagrfillet@gmail.com/
[2] http://ix.io/4B9e
[3] http://ix.io/4B9f
More information about the linux-riscv
mailing list