mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K
[ Upstream commit71c190249f] The intended optimization should be A ^ 0 = A, not A ^ -1 = A. Fixes:cd7df56ed3("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4523507c52
commit
7ca1faa52b
@@ -2306,7 +2306,7 @@ static int xor_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
|
||||
|
||||
static int xor_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
|
||||
{
|
||||
return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !~meta->insn.imm);
|
||||
return wrp_alu32_imm(nfp_prog, meta, ALU_OP_XOR, !meta->insn.imm);
|
||||
}
|
||||
|
||||
static int and_reg(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
|
||||
|
||||
Reference in New Issue
Block a user