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 <[email protected]> Reviewed-by: Hari Bathini <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 3c086ce commit a71c0b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)