Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 12-argument support for RV64 bpf trampoline #7061

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: Add 12-argument support for RV64 bpf trampoline
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 71ed6c2
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6f130e4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f4aba34
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1b0215a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6c8d759
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a87f34e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ecec188
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

Pu Lehui added 3 commits May 24, 2024 08:07
This patch adds 12 function arguments support for riscv64 bpf
trampoline. The current bpf trampoline supports <= sizeof(u64) bytes
scalar arguments [0] and <= 16 bytes struct arguments [1]. Therefore, we
focus on the situation where scalars are at most XLEN bits and
aggregates whose total size does not exceed 2×XLEN bits in the riscv
calling convention [2].

Link: https://elixir.bootlin.com/linux/v6.8/source/kernel/bpf/btf.c#L6184 [0]
Link: https://elixir.bootlin.com/linux/v6.8/source/kernel/bpf/btf.c#L6769 [1]
Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/download/draft-20230929-e5c800e661a53efe3c2678d71a306323b60eb13b/riscv-abi.pdf [2]
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Acked-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Factor out many args tests from tracing_struct and rename some function
names to make more sense.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Add testcase where 7th argument is struct for architectures with 8
argument registers, and increase the complexity of the struct.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Acked-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: c12603e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e944fc8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
version: 4

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=854140
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: riscv, bpf: Add 12-argument support for RV64 bpf trampoline
Using index info to reconstruct a base tree...
M	arch/riscv/net/bpf_jit_comp64.c
Falling back to patching base and 3-way merge...
Auto-merging arch/riscv/net/bpf_jit_comp64.c
CONFLICT (content): Merge conflict in arch/riscv/net/bpf_jit_comp64.c
Patch failed at 0001 riscv, bpf: Add 12-argument support for RV64 bpf trampoline
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch'

conflict:

diff --cc arch/riscv/net/bpf_jit_comp64.c
index c21a0ff23415,da8c75024f77..000000000000
--- a/arch/riscv/net/bpf_jit_comp64.c
+++ b/arch/riscv/net/bpf_jit_comp64.c
@@@ -868,7 -889,13 +889,17 @@@ static int __arch_prepare_bpf_trampolin
  	stack_size += 8;
  	sreg_off = stack_size;
  
++<<<<<<< HEAD
 +	stack_size = round_up(stack_size, STACK_ALIGN);
++=======
+ 	if (nr_arg_slots - RV_MAX_REG_ARGS > 0)
+ 		stack_size += (nr_arg_slots - RV_MAX_REG_ARGS) * 8;
+ 
+ 	stack_size = round_up(stack_size, 16);
++>>>>>>> riscv, bpf: Add 12-argument support for RV64 bpf trampoline
+ 
+ 	/* room for args on stack must be at the top of stack */
+ 	stk_arg_off = stack_size;
  
  	if (!is_struct_ops) {
  		/* For the trampoline called from function entry,

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=840902 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
0 participants