Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3231460imc; Wed, 13 Mar 2019 12:13:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuj+od0Y2BWUDUyKvlw2yc7TqcBpM6JoVTVsu2lCtV6r7TKONFaACUIJCL3m5xy7lZgEeC X-Received: by 2002:a63:ee55:: with SMTP id n21mr12097151pgk.211.1552504431199; Wed, 13 Mar 2019 12:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552504431; cv=none; d=google.com; s=arc-20160816; b=iP0BYGOo35rW1qM6qhj0OqljlCIAA4KZWUmuSBFGVyw+hd5FKViwml3gOWqyrXhw3M FHwQu+/yUmHpETljnNSKhU2EZi1cOb/FgfsNFoBPG/VLYXK1889gI5octGAJYRg9E/pS bjuQ0S4P2VxTWpj1E6lxwggwQkte352XAiSXTD9mtCUM97AxQWbbBE8SPeVsd2uwSNMD RcrDxjN6+oCvb/rVN1NLi3OYk/mkDQp2UE+fWcKTr6hiKQocsqlNKdokWtVahAgBOdtu +GPkwZRqL8GFfyH9lV9qrik3pvju/txiDrc5RBScB/5ahZyCCHpUT+CpYCo1ZV4d6jzT 1lKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8w1vz/DDQyuwvYy+NOHINOxmanTun+kAHmyEG1ly3Mo=; b=uwjj2RfggSEwqBO8ANt7QIktZZrj6f4gV6fxDNxShCstfg35qh7RtEvdwx6AnPqUXF Pnb+gigc0HjUytMKDP5qILYzMY/vFGYiUcHoljzdoqbWenT84Q76NlgHtp0db0mUOy6v Pig5SSctSZI+Afk20G6/oSfap6o/CAXurV+w8ycJ6YpvvEailtfJi8UllidEkiJJGDYf VFZ3aCgRH893jU48D5miC9h4p8iz4a4bHLNcHC7TEkeHuAsj4hcGfWrY5mE1akEE7WsK YC8d0t66xFF5Fol8sIK58lvn3Hn87KRBkKDBkr84wJVmgcFzyW7LDvYWWX4OnpTtrw2k pzrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V8y3wJXt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q124si10619572pgq.526.2019.03.13.12.13.34; Wed, 13 Mar 2019 12:13:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V8y3wJXt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727767AbfCMTMg (ORCPT + 99 others); Wed, 13 Mar 2019 15:12:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:43176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbfCMTMf (ORCPT ); Wed, 13 Mar 2019 15:12:35 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4633621871; Wed, 13 Mar 2019 19:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504354; bh=0xOAyFmhk06ZGLVjVE99rx1PYfwNibq4u5tzXeA1xYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V8y3wJXt1PBa5VnVmluaOoiQORnPcI4D2MpQMnEhiRcWpoyoRFT8PiU8SmfaQrzLp N1sgpCLU+RBMDfn4sh0CB8Ah5yoaQ4OC4YYgGqPUodlxzYl83KUz4hLZbPn9xCm+D7 9hYmbKqRyfcNUYkBITApb+hVRNygc9oJgdBIXwJY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiong Wang , Daniel Borkmann , Sasha Levin , netdev@vger.kernel.org, bpf@vger.kernel.org, oss-drivers@netronome.com Subject: [PATCH AUTOSEL 4.20 54/60] nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K Date: Wed, 13 Mar 2019 15:10:15 -0400 Message-Id: <20190313191021.158171-54-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiong Wang [ Upstream commit 71c190249f0ced5b26377ea6bf829ab3af77a40c ] The intended optimization should be A ^ 0 = A, not A ^ -1 = A. Fixes: cd7df56ed3e6 ("nfp: add BPF to NFP code translator") Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/netronome/nfp/bpf/jit.c b/drivers/net/ethernet/netronome/nfp/bpf/jit.c index 97d33bb4d84d..0762401ee3fe 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/jit.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/jit.c @@ -2309,7 +2309,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) -- 2.19.1