Skip to contentSkip to conversation

powerpc32/bpf: fix loading fsession func metadata using PPC_LI32

PATCH In review [email protected] 2 participants 2 messages Apr 8

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc32/bpf: fix loading fsession func metadata using PPC_LI32

From: Abhishek Dubey <[email protected]>

PPC_RAW_LI32 is not a valid macro in the PowerPC BPF JIT. Use PPC_LI32, which correctly handles immediate loads for large values. Fixes the build error introduced when adding fsession support on ppc32.

---
Need to apply on tp of powerpc -next, as this fixes a build error reported on that branch

 arch/powerpc/net/bpf_jit_comp32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/net/bpf_jit_comp32.c +2 -2
index f3ae89e1d1d0..bfdc50740da8 100644
@@ -150,11 +150,11 @@ void store_func_meta(u32 *image, struct codegen_context *ctx,
 	 * func_meta := argument count in first byte + cookie value
 	 */
 	/* Store lower word */
-	EMIT(PPC_RAW_LI32(bpf_to_ppc(TMP_REG), (u32)func_meta));
+	PPC_LI32(bpf_to_ppc(TMP_REG), (u32)func_meta);
 	EMIT(PPC_RAW_STW(bpf_to_ppc(TMP_REG), _R1, func_meta_off));
 
 	/* Store upper word */
-	EMIT(PPC_RAW_LI32(bpf_to_ppc(TMP_REG), (u32)(func_meta >> 32)));
+	PPC_LI32(bpf_to_ppc(TMP_REG), (u32)(func_meta >> 32));
 	EMIT(PPC_RAW_STW(bpf_to_ppc(TMP_REG), _R1, func_meta_off + 4));
 }
 
Signature · 1 line
2.52.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On 08/04/26 11:23 am, [email protected] wrote:

From: Abhishek Dubey <[email protected]>

PPC_RAW_LI32 is not a valid macro in the PowerPC BPF JIT. Use PPC_LI32, which correctly handles immediate loads for large values. Fixes the build error introduced when adding fsession support on ppc32.

Thanks for the fix.

Quoted 28 lines

---
Need to apply on tp of powerpc -next, as this fixes a build error reported on that branch

  arch/powerpc/net/bpf_jit_comp32.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/net/bpf_jit_comp32.c +2 -2
index f3ae89e1d1d0..bfdc50740da8 100644
@@ -150,11 +150,11 @@ void store_func_meta(u32 *image, struct codegen_context *ctx,
  	 * func_meta := argument count in first byte + cookie value
  	 */
  	/* Store lower word */
-	EMIT(PPC_RAW_LI32(bpf_to_ppc(TMP_REG), (u32)func_meta));
+	PPC_LI32(bpf_to_ppc(TMP_REG), (u32)func_meta);
  	EMIT(PPC_RAW_STW(bpf_to_ppc(TMP_REG), _R1, func_meta_off));
 
  	/* Store upper word */
-	EMIT(PPC_RAW_LI32(bpf_to_ppc(TMP_REG), (u32)(func_meta >> 32)));
+	PPC_LI32(bpf_to_ppc(TMP_REG), (u32)(func_meta >> 32));
  	EMIT(PPC_RAW_STW(bpf_to_ppc(TMP_REG), _R1, func_meta_off + 4));
  }