bpf, riscv: Add BPF stack arguments support for RV64 JIT - #13292
bpf, riscv: Add BPF stack arguments support for RV64 JIT#13292kernel-patches-daemon-bpf[bot] wants to merge 3 commits into
Conversation
|
Upstream branch: 4d9551b |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 5288747708 via email |
c66e1e2 to
114cb6a
Compare
|
Upstream branch: 409a9bd |
3e25306 to
2091472
Compare
114cb6a to
ddff495
Compare
|
Upstream branch: c7e6175 |
2091472 to
960b6f3
Compare
ddff495 to
b9ccff2
Compare
|
Upstream branch: f2aaa62 |
960b6f3 to
450fb32
Compare
b9ccff2 to
424a46b
Compare
|
Upstream branch: f2aaa62 |
450fb32 to
0190096
Compare
424a46b to
e69f735
Compare
|
Upstream branch: 90bd032 |
0190096 to
48946d4
Compare
e69f735 to
e1aa572
Compare
|
Upstream branch: a2b83a8 |
48946d4 to
d142f30
Compare
e1aa572 to
7cd2fe5
Compare
|
Upstream branch: fdd4fad |
d142f30 to
3241b01
Compare
7b509dc to
93097fe
Compare
|
Upstream branch: 8eb1892 |
eddb544 to
ab63d5d
Compare
93097fe to
b51acce
Compare
|
Upstream branch: d99bda7 |
ab63d5d to
7122f6e
Compare
b51acce to
b27c6f9
Compare
|
Upstream branch: 34e0eb7 |
7122f6e to
2e80738
Compare
b27c6f9 to
5d621a7
Compare
|
Upstream branch: 5fe7007 |
2e80738 to
8dcf701
Compare
5d621a7 to
81e4232
Compare
|
Upstream branch: 77877bf |
8dcf701 to
66fdd79
Compare
81e4232 to
f0e6afe
Compare
|
Upstream branch: adb7719 |
66fdd79 to
56189a9
Compare
f0e6afe to
7ac20a0
Compare
|
Upstream branch: 6b0835a |
56189a9 to
f0edceb
Compare
7ac20a0 to
fd7f5fa
Compare
|
Upstream branch: 6ab6a94 |
Add bpf_jit_supports_stack_args() for the RV64 JIT so BPF subprograms and kfuncs can receive more than 5 arguments via the stack (BPF_REG_PARAMS / r11). For BPF-to-BPF calls the caller writes outgoing arguments at the bottom of its frame (SP-relative). The callee reads them with FP-relative loads. Its FP is set to the caller SP in the prologue, so the offsets match. The RISC-V ABI puts arguments 6-8 in A5-A7 and arguments 9+ at SP+0. Before each kfunc call, load arguments 6-8 from the outgoing area into A5-A7 and copy any remaining arguments down so argument 9 lands at SP+0. A5 (BPF_REG_0), A6 (TCC) and A7 are safe to clobber here: R0 is not live before a call, TCC is backed up on the stack, and A7 is unused by the JIT. Limit the existing kfunc sign-extension loop to MAX_BPF_FUNC_REG_ARGS iterations; otherwise idx >= 5 resolves to S1-S5 (BPF_R6-FP) and corrupts callee-saved registers. Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Enable the stack argument selftests for RV64. The riscv guard is restricted to __riscv_xlen == 64 since stack arguments are only supported by the RV64 JIT. Keep the __BPF_FEATURE_STACK_ARGUMENT gate, defined by clang with BPF stack argument support [1]. [1] llvm/llvm-project#189060 Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
f0edceb to
638ba8c
Compare
fd7f5fa to
23ff631
Compare
Pull request for series with
subject: bpf, riscv: Add BPF stack arguments support for RV64 JIT
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1145772