]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 13:35:16 +0000 (14:35 +0100)
commitab7e40e70e5e14479cbd7b3a2c787b64110eef2d
tree48157080c723b590717525504913eb3782487924
parentfbcf59a9a8a286d2e36564e1e3aead0e62283b51
nfp: bpf: fix ALU32 high bits clearance bug

[ Upstream commit f036ebd9bfbe1e91a3d855e85e05fc5ff156b641 ]

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: cd7df56ed3e6 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/netronome/nfp/bpf/jit.c