Skip to content

Commit a71c0b0

Browse files
sm00thmpe
authored andcommitted
powerpc64/bpf: jit support for unconditional byte swap
Add jit support for unconditional byte swap. Tested using BSWAP tests from test_bpf module. Signed-off-by: Artem Savkov <asavkov@redhat.com> Reviewed-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240517075650.248801-3-asavkov@redhat.com
1 parent 3c086ce commit a71c0b0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/powerpc/net/bpf_jit_comp64.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,12 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
699699
*/
700700
case BPF_ALU | BPF_END | BPF_FROM_LE:
701701
case BPF_ALU | BPF_END | BPF_FROM_BE:
702+
case BPF_ALU64 | BPF_END | BPF_FROM_LE:
702703
#ifdef __BIG_ENDIAN__
703704
if (BPF_SRC(code) == BPF_FROM_BE)
704705
goto emit_clear;
705706
#else /* !__BIG_ENDIAN__ */
706-
if (BPF_SRC(code) == BPF_FROM_LE)
707+
if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE)
707708
goto emit_clear;
708709
#endif
709710
switch (imm) {

0 commit comments

Comments
 (0)