]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: BPF: Quit clobbering callee saved registers in JIT code.
authorDavid Daney <david.daney@cavium.com>
Tue, 14 Mar 2017 21:21:43 +0000 (14:21 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 10 Apr 2017 09:56:05 +0000 (11:56 +0200)
commitf32927655ac8fbefbecd273e66d8a92ea79bacaa
tree43072e680174b34ffbaf5afe592091b45a273111
parentab37e23aff741585f19644f1c29d07e80fcc3d71
MIPS: BPF: Quit clobbering callee saved registers in JIT code.

If bpf_needs_clear_a() returns true, only actually clear it if it is
ever used.  If it is not used, we don't save and restore it, so the
clearing has the nasty side effect of clobbering caller state.

Also, don't emit stack pointer adjustment instructions if the
adjustment amount is zero.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Steven J. Hill <steven.hill@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15745/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/net/bpf_jit.c