Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5591702img; Wed, 27 Mar 2019 11:17:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg+gSi0ZYfbwcp4GCECgMTHtaMvNGsId6M03F1+/rqsVqjZBzVq7dc4E7J4M3cBtioSboI X-Received: by 2002:a63:54b:: with SMTP id 72mr35192237pgf.323.1553710629495; Wed, 27 Mar 2019 11:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710629; cv=none; d=google.com; s=arc-20160816; b=xNxZhJRSspSPYVZCPpFS340BwAKqFAUODI9GNTno12nkFRrf3LHbma4Sdsbyd5jzyg CO7+Xs47F/i7wOun2OLDCCba4Tb9EZ2SAP05WD2M08W4VZFr6EMN57+IOdRK7vHDa1IU 9M1t7CbIKZkrI2/pSNI9r0XXjnsMwsYJdmqwqpApD0YyxrGtvoh+FGiTtWYOIYC/5AHf XAwpv+yl38GpVlOf3kQ+UM6faw3EvNgc7RZYVsTrVUTui/29IH2wsHiyu/g+hhiHgF5C Hv0cQnctGSWpHWoeTf24Ju2EmJCFqlLX6EshKtJ5w/99xHAOk656Cl+JFUshWKrE4KnP 6dLw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=/GQ3PoXyTSRUtE1BhjDpnMLjUgf+n2ekMVq0YuFfjJA=; b=U6LTc0znpLOXeLGE4u3l/5ykMOtSz2JasisoY7H68gKbuLp0+K+4dKahKOPmn2xxWu 8+79IDKvR/RtCJO9VQaEoCPQOTI3tIpxQP0ASI9Eel0paRIu6lFBeTV+Xo/qB+OryUT9 LDVeER+SaTXL3RxaqWxEgOcSmmnvqbCwWq04WEb4F5rPm+52O2w25QqmO/DpPAI8rKLo 3/tXFSfNAri3VKawQqTjp4Nu7q3v6lKCJxCjf0GLBDljfdlRX/YUyrr1bFhpZmZaq9FV dtKhB+uQ0HZxZ8A7N1IkoRmE4Jv0/XUF2fiMp7HaU7kVDVb9JrRIZ1wiIn/sJ5mH743/ 8AtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=Ofmje5At; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z184si19287554pfz.131.2019.03.27.11.16.54; Wed, 27 Mar 2019 11:17:09 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=Ofmje5At; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389733AbfC0SPB (ORCPT + 99 others); Wed, 27 Mar 2019 14:15:01 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:45569 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389713AbfC0SO5 (ORCPT ); Wed, 27 Mar 2019 14:14:57 -0400 Received: by mail-qt1-f195.google.com with SMTP id v20so19948889qtv.12 for ; Wed, 27 Mar 2019 11:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=/GQ3PoXyTSRUtE1BhjDpnMLjUgf+n2ekMVq0YuFfjJA=; b=Ofmje5At1uBCTAvYa4Ci2jETuoPaMHv7iGQlVPbYHuuEc23giA3sFtE6B0YUKRxG2Y LP7ILExr1YL+bhZln/f1sSjFWyezHaiRLeCTC05Aus4ox29UPbldbyGBio1s+rh7BRA2 +GpmMP8QRMqPvgcMZeegz07sjdVv0pKbbvN/FHO/tcq8i1OqmbxV30mwkIQYLpxwba8c xCrXIcdaqx8mQLB8lRL9iRSGGl+fcrLWy/u63Z+qq5OWfVMkaynEOKMEE5bc60LwG7mQ kAVIk9Q2IiSuvOlpPfLOc04Gi46DRN8rfm+wH7QMrpEG1ZCfy1Ljsyd2bndfAkEfaboC kvlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=/GQ3PoXyTSRUtE1BhjDpnMLjUgf+n2ekMVq0YuFfjJA=; b=kS1EY+3W7ZrnsYNRgoD6bo54Li5WiL1tXr8q1+dzK2VX92j4+smrKptvediFrypvme /V6hI8CTyLvcXqDN49+xKhv+E8Uj46QeqIbXwW7yherDhIJ6DLAmeGKUObBdBw0pqJXU BAJUcb2b04aRn9TW1JeNPI7iLuq5Nl+ApQbvIa//gqXTEgq5Hvl00Xv1LbOzfwLuKz3T 6Rz5c8gyhsXKoypXVmphyaKI9vU7HWq3LOsUUT0KZN9WCwW6c3963Q+3zQN69pj7ETwE yJ1A2KpokrmrJDyM/Dh4zRxjld34BlAgd+GxTmpS2tnIaDR4XshhuAgxX7PNLaSGYhKF 7+ig== X-Gm-Message-State: APjAAAXylMchBURMPpoy4dOAKOttjmCROb6pidcoy0/4KLkpf9qlwse5 BHZr7mXvRxtt63jCjdRmPFSPFw== X-Received: by 2002:ac8:2692:: with SMTP id 18mr31963871qto.343.1553710496568; Wed, 27 Mar 2019 11:14:56 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id r201sm5912689qke.37.2019.03.27.11.14.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:14:56 -0700 (PDT) Date: Wed, 27 Mar 2019 11:14:52 -0700 From: Jakub Kicinski To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jiong Wang , Alexei Starovoitov , netdev@vger.kernel.org, bpf@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [oss-drivers] [PATCH AUTOSEL 5.0 192/262] nfp: bpf: correct the behavior for shifts by zero Message-ID: <20190327111452.379db173@cakuba.netronome.com> In-Reply-To: <20190327180158.10245-192-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> <20190327180158.10245-192-sashal@kernel.org> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Mar 2019 14:00:47 -0400, Sasha Levin wrote: > From: Jiong Wang > > [ Upstream commit db0a4b3b6b83a081a9ec309cc8178e5c9b4706a5 ] > > Shifts by zero do nothing, and should be treated as nops. > > Even though compiler is not supposed to generate such instructions and > manual written assembly is unlikely to have them, but they are legal > instructions and have defined behavior. > > This patch correct existing shifts code-gen to make sure they do nothing > when shift amount is zero except when the instruction is ALU32 for which > high bits need to be cleared. > > For shift amount bigger than type size, already, NFP JIT back-end errors > out for immediate shift and only low 5 bits will be taken into account for > indirect shift which is the same as x86. > > Reviewed-by: Jakub Kicinski > Signed-off-by: Jiong Wang > Signed-off-by: Alexei Starovoitov > Signed-off-by: Sasha Levin Nope.