diff options
author | Artem Savkov <asavkov@redhat.com> | 2024-05-17 09:56:47 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-07-11 15:40:21 +1000 |
commit | a71c0b09a14db72d59c48a8cda7a73032f4d418b (patch) | |
tree | eadec4d61cd27bd13effbdfdfaa128179c3f78c7 /arch/powerpc | |
parent | 3c086ce222cefcf16d412faa10d456161d076796 (diff) |
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
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/net/bpf_jit_comp64.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c index f1d7fcdeb14a..7de41e80c61f 100644 --- a/arch/powerpc/net/bpf_jit_comp64.c +++ b/arch/powerpc/net/bpf_jit_comp64.c @@ -699,11 +699,12 @@ bpf_alu32_trunc: */ case BPF_ALU | BPF_END | BPF_FROM_LE: case BPF_ALU | BPF_END | BPF_FROM_BE: + case BPF_ALU64 | BPF_END | BPF_FROM_LE: #ifdef __BIG_ENDIAN__ if (BPF_SRC(code) == BPF_FROM_BE) goto emit_clear; #else /* !__BIG_ENDIAN__ */ - if (BPF_SRC(code) == BPF_FROM_LE) + if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE) goto emit_clear; #endif switch (imm) { |