]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: bpf: fix ALU32 high bits clearance bug
authorJiong Wang <jiong.wang@netronome.com>
Fri, 22 Feb 2019 22:36:04 +0000 (22:36 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 22 Feb 2019 23:07:47 +0000 (00:07 +0100)
commit97628f138a73606324ff1fa7215f0a98edef7003
treeb676669c186253e4a40026c2f70da6b88b5bf933
parente154e1b11f93cf5ec0ebf57761f49c60a1843def
nfp: bpf: fix ALU32 high bits clearance bug

NFP BPF JIT compiler is doing a couple of small optimizations when jitting
ALU imm instructions, some of these optimizations could save code-gen, for
example:

  A & -1 =  A
  A |  0 =  A
  A ^  0 =  A

However, for ALU32, high 32-bit of the 64-bit register should still be
cleared according to ISA semantics.

Fixes: 55ffbdbb0433 ("nfp: add BPF to NFP code translator")
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c