]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: extend is_branch_taken to registers
authorAlexei Starovoitov <ast@kernel.org>
Sat, 15 Jun 2019 19:12:19 +0000 (12:12 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 19 Jun 2019 00:22:51 +0000 (02:22 +0200)
commit74db1871bcf2ad15a90844bedaa8eee2d43f7a25
tree69e0a487f6b8cdb6847bcaf35180ee62a1a992a2
parentb658a064f642da2f7af9278cfd89453a1ef3249b
bpf: extend is_branch_taken to registers

This patch extends is_branch_taken() logic from JMP+K instructions
to JMP+X instructions.
Conditional branches are often done when src and dst registers
contain known scalars. In such case the verifier can follow
the branch that is going to be taken when program executes.
That speeds up the verification and is essential feature to support
bounded loops.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/verifier.c