]> git.baikalelectronics.ru Git - kernel.git/commit
x86: bpf_jit: small optimization in emit_bpf_tail_call()
authorEric Dumazet <edumazet@google.com>
Thu, 31 Aug 2017 11:53:42 +0000 (04:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Aug 2017 18:57:37 +0000 (11:57 -0700)
commit1648bc81e5ad9edebb1bcc2f925880c21e041b70
tree86577241d7a33a02dc714cbfd0c32fa7c19ebd8d
parentc6b62bd425541443df99f80307d074a4be7c180a
x86: bpf_jit: small optimization in emit_bpf_tail_call()

Saves 4 bytes replacing following instructions :

lea rax, [rsi + rdx * 8 + offsetof(...)]
mov rax, qword ptr [rax]
cmp rax, 0

by :

mov rax, [rsi + rdx * 8 + offsetof(...)]
test rax, rax

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/x86/net/bpf_jit_comp.c