]> 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)
commitbc626cc09c392dbe3db257642040bf7e95dd78c6
tree69e0a487f6b8cdb6847bcaf35180ee62a1a992a2
parent2599925f24a06b450a2f92cba61fbac4725e916f
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