aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-01-26 17:33:40 -0500
committerAlexei Starovoitov <ast@kernel.org>2018-01-26 19:42:06 -0500
commit3e5b1a39d7cfaa3c023c17f5d12b3f22af046929 (patch)
treef139834adf49f268f427600ae01ec1ab662baff8
parentf6b1b3bf0d5f681631a293cfe1ca934b81716f1e (diff)
bpf, x86_64: 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 x86_64 JIT. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--arch/x86/net/bpf_jit_comp.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 5acee5139e28..4923d92f918d 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -568,26 +568,6 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
568 */ 568 */
569 EMIT2(0x31, 0xd2); 569 EMIT2(0x31, 0xd2);
570 570
571 if (BPF_SRC(insn->code) == BPF_X) {
572 /* if (src_reg == 0) return 0 */
573
574 /* cmp r11, 0 */
575 EMIT4(0x49, 0x83, 0xFB, 0x00);
576
577 /* jne .+9 (skip over pop, pop, xor and jmp) */
578 EMIT2(X86_JNE, 1 + 1 + 2 + 5);
579 EMIT1(0x5A); /* pop rdx */
580 EMIT1(0x58); /* pop rax */
581 EMIT2(0x31, 0xc0); /* xor eax, eax */
582
583 /* jmp cleanup_addr
584 * addrs[i] - 11, because there are 11 bytes
585 * after this insn: div, mov, pop, pop, mov
586 */
587 jmp_offset = ctx->cleanup_addr - (addrs[i] - 11);
588 EMIT1_off32(0xE9, jmp_offset);
589 }
590
591 if (BPF_CLASS(insn->code) == BPF_ALU64) 571 if (BPF_CLASS(insn->code) == BPF_ALU64)
592 /* div r11 */ 572 /* div r11 */
593 EMIT3(0x49, 0xF7, 0xF3); 573 EMIT3(0x49, 0xF7, 0xF3);