mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
bpf, mips: Add JIT support for unconditional BSWAP
The unconditional BSWAP instruction from the eBPF v4 ISA was not implemented. This caused programs using the instruction to fall back to the interpreter. Implement the unconditional BSWAP instruction. Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20260925231932.1063678-2-johan.almbladh@anyfinetworks.com
This commit is contained in:
parent
6ac134ec93
commit
89d8e19811
|
|
@ -1701,6 +1701,10 @@ int build_insn(const struct bpf_insn *insn, struct jit_context *ctx)
|
|||
case BPF_ALU64 | BPF_MOD | BPF_X:
|
||||
emit_divmod_r64(ctx, dst, src, BPF_OP(code), off);
|
||||
break;
|
||||
/* dst = bswap(dst) */
|
||||
case BPF_ALU64 | BPF_END:
|
||||
emit_bswap_r64(ctx, dst, imm);
|
||||
break;
|
||||
/* dst = htole(dst) */
|
||||
/* dst = htobe(dst) */
|
||||
case BPF_ALU | BPF_END | BPF_FROM_LE:
|
||||
|
|
|
|||
|
|
@ -876,6 +876,10 @@ int build_insn(const struct bpf_insn *insn, struct jit_context *ctx)
|
|||
case BPF_ALU64 | BPF_MOD | BPF_X:
|
||||
emit_alu_r64(ctx, dst, src, BPF_OP(code), off);
|
||||
break;
|
||||
/* dst = bswap(dst) */
|
||||
case BPF_ALU64 | BPF_END:
|
||||
emit_bswap_r64(ctx, dst, imm);
|
||||
break;
|
||||
/* dst = htole(dst) */
|
||||
/* dst = htobe(dst) */
|
||||
case BPF_ALU | BPF_END | BPF_FROM_LE:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user