]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: bpf: Fix branch conditional for BPF_J{GT/GE} cases
authorMarkos Chandras <markos.chandras@imgtec.com>
Mon, 23 Jun 2014 09:38:51 +0000 (10:38 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 26 Jun 2014 09:48:21 +0000 (10:48 +0100)
commit2357942e68495575be1e251d3681d0b5aa06e091
treeb8354bcd27d9f6056a61b1b311a16ec67b8e03f8
parent5388a383754f5a027ddee7094c5a227942415ca7
MIPS: bpf: Fix branch conditional for BPF_J{GT/GE} cases

The sltiu and sltu instructions will set the scratch register
to 1 if A <= X|K so fix the emitted branch conditional to check
for scratch != zero rather than scratch >= zero which would complicate
the resuling branch logic given that MIPS does not have a BGT or BGET
instructions to compare general purpose registers directly.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7126/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/net/bpf_jit.c