]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit6d0fdcadde9450d4159ef7eaf54f4e46504dacf7
tree6bd1a927515fc1294069ac99c449677140da6fc8
parent25743426f975c19d5737749f626cad7ef378d874
nfp: bpf: fix ALU32 high bits clearance bug

BugLink: https://bugs.launchpad.net/bugs/1837952
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/netronome/nfp/bpf/jit.c