mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
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
This commit is contained in:
parent
3c086ce222
commit
a71c0b09a1
|
|
@ -699,11 +699,12 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
|
|||
*/
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user