Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf,powerpc: Add support for bpf arena and arena atomics
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=988333

@kernel-patches-daemon-bpf-rc
Copy link
Author

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

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

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: bpf,powerpc: Introduce bpf_jit_emit_probe_mem_store() to emit store instructions
Using index info to reconstruct a base tree...
M	arch/powerpc/net/bpf_jit_comp64.c
Falling back to patching base and 3-way merge...
Auto-merging arch/powerpc/net/bpf_jit_comp64.c
CONFLICT (content): Merge conflict in arch/powerpc/net/bpf_jit_comp64.c
Patch failed at 0001 bpf,powerpc: Introduce bpf_jit_emit_probe_mem_store() to emit store instructions'
  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/powerpc/net/bpf_jit_comp64.c
index 5daa77aee7f7,489de21fe3d6..000000000000
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@@ -392,6 -409,101 +392,104 @@@ asm 
  "		blr				;"
  );
  
++<<<<<<< HEAD
++=======
+ static int bpf_jit_emit_probe_mem_store(struct codegen_context *ctx, u32 src_reg, s16 off,
+ 					u32 code, u32 *image)
+ {
+ 	u32 tmp1_reg = bpf_to_ppc(TMP_REG_1);
+ 	u32 tmp2_reg = bpf_to_ppc(TMP_REG_2);
+ 
+ 	switch (BPF_SIZE(code)) {
+ 	case BPF_B:
+ 		EMIT(PPC_RAW_STB(src_reg, tmp1_reg, off));
+ 		break;
+ 	case BPF_H:
+ 		EMIT(PPC_RAW_STH(src_reg, tmp1_reg, off));
+ 		break;
+ 	case BPF_W:
+ 		EMIT(PPC_RAW_STW(src_reg, tmp1_reg, off));
+ 		break;
+ 	case BPF_DW:
+ 		if (off % 4) {
+ 			EMIT(PPC_RAW_LI(tmp2_reg, off));
+ 			EMIT(PPC_RAW_STDX(src_reg, tmp1_reg, tmp2_reg));
+ 		} else {
+ 			EMIT(PPC_RAW_STD(src_reg, tmp1_reg, off));
+ 		}
+ 		break;
+ 	default:
+ 		return -EINVAL;
+ 	}
+ 	return 0;
+ }
+ 
+ static int emit_atomic_ld_st(const struct bpf_insn insn, struct codegen_context *ctx, u32 *image)
+ {
+ 	u32 code = insn.code;
+ 	u32 dst_reg = bpf_to_ppc(insn.dst_reg);
+ 	u32 src_reg = bpf_to_ppc(insn.src_reg);
+ 	u32 size = BPF_SIZE(code);
+ 	u32 tmp1_reg = bpf_to_ppc(TMP_REG_1);
+ 	u32 tmp2_reg = bpf_to_ppc(TMP_REG_2);
+ 	s16 off = insn.off;
+ 	s32 imm = insn.imm;
+ 
+ 	switch (imm) {
+ 	case BPF_LOAD_ACQ:
+ 		switch (size) {
+ 		case BPF_B:
+ 			EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off));
+ 			break;
+ 		case BPF_H:
+ 			EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off));
+ 			break;
+ 		case BPF_W:
+ 			EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off));
+ 			break;
+ 		case BPF_DW:
+ 			if (off % 4) {
+ 				EMIT(PPC_RAW_LI(tmp1_reg, off));
+ 				EMIT(PPC_RAW_LDX(dst_reg, src_reg, tmp1_reg));
+ 			} else {
+ 				EMIT(PPC_RAW_LD(dst_reg, src_reg, off));
+ 			}
+ 			break;
+ 		}
+ 		EMIT(PPC_RAW_LWSYNC());
+ 		break;
+ 	case BPF_STORE_REL:
+ 		EMIT(PPC_RAW_LWSYNC());
+ 		switch (size) {
+ 		case BPF_B:
+ 			EMIT(PPC_RAW_STB(src_reg, dst_reg, off));
+ 			break;
+ 		case BPF_H:
+ 			EMIT(PPC_RAW_STH(src_reg, dst_reg, off));
+ 			break;
+ 		case BPF_W:
+ 			EMIT(PPC_RAW_STW(src_reg, dst_reg, off));
+ 			break;
+ 		case BPF_DW:
+ 			if (off % 4) {
+ 				EMIT(PPC_RAW_LI(tmp2_reg, off));
+ 				EMIT(PPC_RAW_STDX(src_reg, dst_reg, tmp2_reg));
+ 			} else {
+ 				EMIT(PPC_RAW_STD(src_reg, dst_reg, off));
+ 			}
+ 			break;
+ 		}
+ 		break;
+ 	default:
+ 		pr_err_ratelimited("unexpected atomic load/store op code %02x\n",
+ 				   imm);
+ 		return -EINVAL;
+ 	}
+ 
+ 	return 0;
+ }
+ 
++>>>>>>> bpf,powerpc: Introduce bpf_jit_emit_probe_mem_store() to emit store instructions
  /* Assemble the body code between the prologue & epilogue */
  int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct codegen_context *ctx,
  		       u32 *addrs, int pass, bool extra_pass)

@kernel-patches-daemon-bpf-rc kernel-patches-daemon-bpf-rc bot force-pushed the series/988333=>bpf-net branch 22 times, most recently from 4074c52 to 6bcb872 Compare August 6, 2025 15:58
@kernel-patches-daemon-bpf-rc
Copy link
Author

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

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.

1 participant