Skip to content

Commit 48164fc

Browse files
rnavmpe
authored andcommitted
powerpc/bpf ppc32: Do not emit zero extend instruction for 64-bit BPF_END
Suppress emitting zero extend instruction for 64-bit BPF_END_FROM_[L|B]E operation. Fixes: 51c66ad ("powerpc/bpf: Implement extended BPF on PPC32") Signed-off-by: Naveen N. Rao <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/b4e3c3546121315a8e2059b19a1bda84971816e4.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
1 parent e8278d4 commit 48164fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/net/bpf_jit_comp32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *
11071107
return -EOPNOTSUPP;
11081108
}
11091109
if (BPF_CLASS(code) == BPF_ALU && !fp->aux->verifier_zext &&
1110-
!insn_is_zext(&insn[i + 1]))
1110+
!insn_is_zext(&insn[i + 1]) && !(BPF_OP(code) == BPF_END && imm == 64))
11111111
EMIT(PPC_RAW_LI(dst_reg_h, 0));
11121112
}
11131113

0 commit comments

Comments
 (0)