Skip to content

bpf: tracing_multi link#11331

Open
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-net_basefrom
series/1061586=>bpf-net
Open

bpf: tracing_multi link#11331
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-net_basefrom
series/1061586=>bpf-net

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: bpf: tracing_multi link
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061586

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f5ada26
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061586
version: 1

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

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: ftrace: Add ftrace_hash_count function
Applying: bpf: Use mutex lock pool for bpf trampolines
Applying: bpf: Add struct bpf_trampoline_ops object
Applying: bpf: Add struct bpf_tramp_node object
Using index info to reconstruct a base tree...
M	arch/arm64/net/bpf_jit_comp.c
M	arch/s390/net/bpf_jit_comp.c
M	include/linux/bpf.h
M	kernel/bpf/syscall.c
Falling back to patching base and 3-way merge...
Auto-merging kernel/bpf/syscall.c
Auto-merging include/linux/bpf.h
Auto-merging arch/s390/net/bpf_jit_comp.c
CONFLICT (content): Merge conflict in arch/s390/net/bpf_jit_comp.c
Auto-merging arch/arm64/net/bpf_jit_comp.c
Patch failed at 0004 bpf: Add struct bpf_tramp_node object'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"'

conflict:

diff --cc arch/s390/net/bpf_jit_comp.c
index bf92964246eb,888e9d717dd5..000000000000
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@@ -2506,9 -2513,16 +2506,9 @@@ static void load_imm64(struct bpf_jit *
  	EMIT6_IMM(0xc00d0000, dst_reg, val);
  }
  
 -static void emit_store_stack_imm64(struct bpf_jit *jit, int tmp_reg, int stack_off, u64 imm)
 -{
 -	load_imm64(jit, tmp_reg, imm);
 -	/* stg %tmp_reg,stack_off(%r15) */
 -	EMIT6_DISP_LH(0xe3000000, 0x0024, tmp_reg, REG_0, REG_15, stack_off);
 -}
 -
  static int invoke_bpf_prog(struct bpf_tramp_jit *tjit,
  			   const struct btf_func_model *m,
- 			   struct bpf_tramp_link *tlink, bool save_ret)
+ 			   struct bpf_tramp_node *node, bool save_ret)
  {
  	struct bpf_jit *jit = &tjit->common;
  	int cookie_off = tjit->run_ctx_off +
@@@ -2517,13 -2531,10 +2517,17 @@@
  	int patch;
  
  	/*
- 	 * run_ctx.cookie = tlink->cookie;
+ 	 * run_ctx.cookie = node->cookie;
  	 */
  
++<<<<<<< HEAD
 +	/* %r0 = tlink->cookie */
 +	load_imm64(jit, REG_W0, tlink->cookie);
 +	/* stg %r0,cookie_off(%r15) */
 +	EMIT6_DISP_LH(0xe3000000, 0x0024, REG_W0, REG_0, REG_15, cookie_off);
++=======
+ 	emit_store_stack_imm64(jit, REG_W0, cookie_off, node->cookie);
++>>>>>>> bpf: Add struct bpf_tramp_node object
  
  	/*
  	 * if ((start = __bpf_prog_enter(p, &run_ctx)) == 0)
@@@ -2581,6 -2592,28 +2585,31 @@@
  	return 0;
  }
  
++<<<<<<< HEAD
++=======
+ static int invoke_bpf(struct bpf_tramp_jit *tjit,
+ 		      const struct btf_func_model *m,
+ 		      struct bpf_tramp_nodes *tn, bool save_ret,
+ 		      u64 func_meta, int cookie_off)
+ {
+ 	int i, cur_cookie = (tjit->bpf_args_off - cookie_off) / sizeof(u64);
+ 	struct bpf_jit *jit = &tjit->common;
+ 
+ 	for (i = 0; i < tn->nr_nodes; i++) {
+ 		if (bpf_prog_calls_session_cookie(tn->nodes[i])) {
+ 			u64 meta = func_meta | ((u64)cur_cookie << BPF_TRAMP_COOKIE_INDEX_SHIFT);
+ 
+ 			emit_store_stack_imm64(jit, REG_0, tjit->func_meta_off, meta);
+ 			cur_cookie--;
+ 		}
+ 		if (invoke_bpf_prog(tjit, m, tn->nodes[i], save_ret))
+ 			return -EINVAL;
+ 	}
+ 
+ 	return 0;
+ }
+ 
++>>>>>>> bpf: Add struct bpf_tramp_node object
  static int alloc_stack(struct bpf_tramp_jit *tjit, size_t size)
  {
  	int stack_offset = tjit->stack_size;
@@@ -2603,15 -2636,17 +2632,15 @@@ static int __arch_prepare_bpf_trampolin
  					 struct bpf_tramp_jit *tjit,
  					 const struct btf_func_model *m,
  					 u32 flags,
- 					 struct bpf_tramp_links *tlinks,
+ 					 struct bpf_tramp_nodes *tnodes,
  					 void *func_addr)
  {
- 	struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
- 	struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
- 	struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
+ 	struct bpf_tramp_nodes *fmod_ret = &tnodes[BPF_TRAMP_MODIFY_RETURN];
+ 	struct bpf_tramp_nodes *fentry = &tnodes[BPF_TRAMP_FENTRY];
+ 	struct bpf_tramp_nodes *fexit = &tnodes[BPF_TRAMP_FEXIT];
  	int nr_bpf_args, nr_reg_args, nr_stack_args;
 -	int cookie_cnt, cookie_off, fsession_cnt;
  	struct bpf_jit *jit = &tjit->common;
  	int arg, bpf_arg_off;
 -	u64 func_meta;
  	int i, j;
  
  	/* Support as many stack arguments as "mvc" instruction can handle. */
@@@ -2643,6 -2678,9 +2672,12 @@@
  			return -ENOTSUPP;
  	}
  
++<<<<<<< HEAD
++=======
+ 	cookie_cnt = bpf_fsession_cookie_cnt(tnodes);
+ 	fsession_cnt = bpf_fsession_cnt(tnodes);
+ 
++>>>>>>> bpf: Add struct bpf_tramp_node object
  	/*
  	 * Calculate the stack layout.
  	 */
@@@ -2767,12 -2802,19 +2802,12 @@@
  		EMIT6_PCREL_RILB_PTR(0xc0050000, REG_14, __bpf_tramp_enter);
  	}
  
 -	if (fsession_cnt) {
 -		/* Clear all the session cookies' value. */
 -		for (i = 0; i < cookie_cnt; i++)
 -			emit_store_stack_imm64(jit, REG_0, cookie_off + 8 * i, 0);
 -		/* Clear the return value to make sure fentry always gets 0. */
 -		emit_store_stack_imm64(jit, REG_0, tjit->retval_off, 0);
 -	}
 -
 -	if (invoke_bpf(tjit, m, fentry, flags & BPF_TRAMP_F_RET_FENTRY_RET,
 -		       func_meta, cookie_off))
 -		return -EINVAL;
 +	for (i = 0; i < fentry->nr_links; i++)
 +		if (invoke_bpf_prog(tjit, m, fentry->links[i],
 +				    flags & BPF_TRAMP_F_RET_FENTRY_RET))
 +			return -EINVAL;
  
- 	if (fmod_ret->nr_links) {
+ 	if (fmod_ret->nr_nodes) {
  		/*
  		 * retval = 0;
  		 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants