OSDN Git Service

x86: bpf_jit: small optimization in emit_bpf_tail_call()
authorEric Dumazet <edumazet@google.com>
Tue, 30 Jan 2018 02:37:39 +0000 (03:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:04:24 +0000 (17:04 +0100)
commit5a802e670c46ee2027ae43ec03501ecdb85d080a
treee77c4a485d1987c711ab48eff14ef1d683781aa7
parent1367d854b97493bfb1f3d24cf89ba60cb7f059ea
x86: bpf_jit: small optimization in emit_bpf_tail_call()

[ upstream commit 84ccac6e7854ebbfb56d2fc6d5bef9be49bb304c ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/net/bpf_jit_comp.c