Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3624852yba; Tue, 7 May 2019 04:32:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwiaDoJjpDvaOS6inlIefXdTJpe5bg31+w1y5V2X39c0FVT6cXOkTfPNpNrAquEClb2zha X-Received: by 2002:a65:478a:: with SMTP id e10mr39282841pgs.310.1557228764890; Tue, 07 May 2019 04:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557228764; cv=none; d=google.com; s=arc-20160816; b=dQPLmAVN3xyAzCLSprTjKKq3QX2smLwAizBuUGUI2K2JO8xK6AcJisdpTZlGIcepR9 GbOHvzEjMRHDc8O8h+hHDT0LU1wGabWhtLw5+vdhm9OoYo6SgJ1O0/YX4+e+9+jt737A qdKOTfo1C39ruD5gkAAvdmrUmdsLXIeYR2pXuN98jHHt0ultMlXs8OsO0CVIAxIIC8dR WYFKTdyKwN+BY118t3zpZZ61UzyoSbDiSeS1OAVUqM/mtlgzIA7Lz2iHzLZBaOhIGZAb ocVxQBiLve8FyS2AlpDde4RW6fnagGNHU+BvbNs0FVdtsJycB/Se+XsxkqBIkLKgGdiV HQ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature; bh=QjMXMsSSirdUYoTUuJO+JEDtUnxzPrM5xgigZEkLnYQ=; b=GWihR1xRPwxoreg3DIJer6qqrQByMKH9iG6y0XJUqEqVvRIUbclbF6tZH25bk9bN8M Xz3XMsvlf71OQPUiCvTg1ZAwDvl8ALBPLiGtgFWYrrI9qGC47KXwIl1VbNG4zTTdn+TO MIoIZThWSrySIE6t9yQH9C04eV8qZT+RdPVw/vLB9bWl8VLLkzXo9nebdYXrxCeDmt5C QrKojljHgGZqQXnTj8RrQK/Vry8+3dZpYF3cVKFik86jQUgAFYd3iy1QMDa3fOXSRp0s J+jZZuelVQI0vdyY3n5qTnbTr+vXCmZ5c2bR3ucFaywtFGZoydOTJmvKmvC2+TrpugPi fSeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=RqOFfDSY; 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 q8si5051599pfa.124.2019.05.07.04.32.28; Tue, 07 May 2019 04:32:44 -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=RqOFfDSY; 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 S1726505AbfEGLbe (ORCPT + 99 others); Tue, 7 May 2019 07:31:34 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:50423 "EHLO mail-wm1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbfEGLbe (ORCPT ); Tue, 7 May 2019 07:31:34 -0400 Received: by mail-wm1-f54.google.com with SMTP id p21so19987726wmc.0 for ; Tue, 07 May 2019 04:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=QjMXMsSSirdUYoTUuJO+JEDtUnxzPrM5xgigZEkLnYQ=; b=RqOFfDSYdz/H0bcGfdSjaCVDatHo8QOFl9VXt50M2D3B0Pl2xxxi0898C7GyYi3zx/ wgaHMiv4lbloz8y3chMJwbSDG05DUC/zjhHpvhcyQZDee25CFO4zB5a9nkeQgBhO/UA+ uz4qOSyAlE8agjyZOCgxdu7k5YhSui3vUYd58viRzWH88/Yfw++XsNAC4vTs/fIbhuY3 4UgDvzWCoOFnH8shxy0lBiaS8kLsM+mqqpqSy0KPVcMz0P8R/ltcUzh1iGkEGoBDM3ia JYSUT2PH9o098h+nPMGyncOBu6+MU350F3EscT3UIFI0IE/B34or+gy5PQm+Y6966eef /4yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=QjMXMsSSirdUYoTUuJO+JEDtUnxzPrM5xgigZEkLnYQ=; b=mRPQgod4knbdBo5RxVJC6D8mAkXSmYzPTwGkOfYbTp+fMjCD0wDgYGGek++7nS7UTG b1VXZBgdCiKUqm0+OFwxmHY7Ih3pwK0Orx3un/YHrE7lcuNlWfCvHNYTu3mK0QU7hyrC tpOcn7WOFB93dp+vU7d0EnKXg5yfc2JY48xgTBISsAQ0Yo/bLJjoIwpTkqZQs/aVDqE6 6usorgOqJUBoZQUbGIt40pOMZR3JzoYmYqJ1JkcuYIzEnyLNels38pKi7NFNt7HTn2+p MMSYp7USn8XC4bzgVxzKUZCY8gSMYlNjkYgRUM7W1paTmDha9y5GpheqH3nsxoZj38WV p2kg== X-Gm-Message-State: APjAAAW7jTI3xoeeR+L2WJjZnu/5BSkHXDMJcynBumu0S/lz8VOb7QT7 /pcQuBFY407RgGKJ3WVC5FLOew== X-Received: by 2002:a1c:cf83:: with SMTP id f125mr19275746wmg.96.1557228692779; Tue, 07 May 2019 04:31:32 -0700 (PDT) Received: from LAPTOP-V3S7NLPL ([217.38.71.146]) by smtp.gmail.com with ESMTPSA id m25sm12848005wmi.45.2019.05.07.04.31.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 May 2019 04:31:31 -0700 (PDT) References: <673b885183fb64f1cbb3ed2387524077@natalenko.name> <87mujzutsw.fsf@netronome.com> <4414f1798ea3c0f70128b7e4caa14edc@natalenko.name> User-agent: mu4e 0.9.18; emacs 25.2.2 From: Jiong Wang To: Oleksandr Natalenko Cc: Jiong Wang , Jakub Kicinski , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, oss-drivers@netronome.com, linux-kernel@vger.kernel.org, xdp-newbies@vger.kernel.org, valdis@vt.edu Subject: Re: [oss-drivers] netronome/nfp/bpf/jit.c cannot be build with -O3 In-reply-to: <4414f1798ea3c0f70128b7e4caa14edc@natalenko.name> Date: Tue, 07 May 2019 12:31:29 +0100 Message-ID: <87ef5abiwe.fsf@netronome.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleksandr Natalenko writes: > Hi. > > On 07.05.2019 00:01, Jiong Wang wrote: >> I guess it's because constant prop. Could you try the following change >> to >> __emit_shift? >> >> drivers/net/ethernet/netronome/nfp/bpf/jit.c >> __emit_shift:331 >> - if (sc == SHF_SC_L_SHF) >> + if (sc == SHF_SC_L_SHF && shift) >> shift = 32 - shift; >> >> emit_shf_indir is passing "0" as shift to __emit_shift which will >> eventually be turned into 32 and it was OK because we truncate to >> 5-bit, >> but before truncation, it will overflow the shift mask. > > Yup, it silences the error for me. Thanks for the testing. I have also reproduced this issue after switching to gcc 8.3, and confirmed the error is triggered from "value too large for the field" check inside __BF_FIELD_CHECK due to immediate "32" is out of range for mask 0x1f. Will send out a fix. Regards, Jiong