Skip to content

Commit 96a7100

Browse files
borkmannAlexei Starovoitov
authored andcommitted
bpf, arm64: remove obsolete exception handling from div/mod
Since we've changed div/mod exception handling for src_reg in eBPF verifier itself, remove the leftovers from arm64 JIT. Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 3e5b1a3 commit 96a7100

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

arch/arm64/net/bpf_jit_comp.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
390390
case BPF_ALU64 | BPF_DIV | BPF_X:
391391
case BPF_ALU | BPF_MOD | BPF_X:
392392
case BPF_ALU64 | BPF_MOD | BPF_X:
393-
{
394-
const u8 r0 = bpf2a64[BPF_REG_0];
395-
396-
/* if (src == 0) return 0 */
397-
jmp_offset = 3; /* skip ahead to else path */
398-
check_imm19(jmp_offset);
399-
emit(A64_CBNZ(is64, src, jmp_offset), ctx);
400-
emit(A64_MOVZ(1, r0, 0, 0), ctx);
401-
jmp_offset = epilogue_offset(ctx);
402-
check_imm26(jmp_offset);
403-
emit(A64_B(jmp_offset), ctx);
404-
/* else */
405393
switch (BPF_OP(code)) {
406394
case BPF_DIV:
407395
emit(A64_UDIV(is64, dst, dst, src), ctx);
@@ -413,7 +401,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
413401
break;
414402
}
415403
break;
416-
}
417404
case BPF_ALU | BPF_LSH | BPF_X:
418405
case BPF_ALU64 | BPF_LSH | BPF_X:
419406
emit(A64_LSLV(is64, dst, dst, src), ctx);

0 commit comments

Comments
 (0)