Messages in this thread | | | From | Björn Töpel <> | Subject | Re: [PATCH v2] riscv, bpf: Adapt bpf trampoline to optimized riscv ftrace framework | Date | Fri, 21 Jul 2023 22:42:12 +0200 |
| |
Pu Lehui <pulehui@huaweicloud.com> writes:
> From: Pu Lehui <pulehui@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@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@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
| |