From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CB6AC43461 for ; Wed, 16 Sep 2020 16:06:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA6CF224B2 for ; Wed, 16 Sep 2020 16:06:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vnjqa72m"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Z9Mjrknp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA6CF224B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EvEiaAfEXY1bFjmkDzTzP+LFXSdFs96zI1CPoKdW7fQ=; b=Vnjqa72mmW2jIn+2wIC9HysDq a7Wjzzv0CAemAZkl7HKLPqSdAXXAS/cbK2X1T2vz4YzHraZkn/j1W/i6GHSvYXy0i8waDMEVYp4lp Kgu24OlUlKRRW47cEjfXkg5lrMhwN5apmTTuK+x4TB+RNsxSFIf51MZzVPovmT0ThjAZA3Xou4A70 Ljuc6wblC+L7qR0bqJhCOwZNsAeajNTniu6muVxldLkvu8FP9u2ZautYR6NBPuCmHge2085QCD9V/ UlapHOOcWHTRgssM31KLEqnTV8VKILj2XStJAqlhfCo8NrRYxdJzHYq33uf94ZlgDHjifDsAGQbZq Q7z+kn4oQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIZvC-0007Ha-35; Wed, 16 Sep 2020 16:04:38 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIZuk-00075s-Ug for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 16:04:12 +0000 Received: by mail-ej1-x643.google.com with SMTP id u21so11146810eja.2 for ; Wed, 16 Sep 2020 09:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/MCv6kGzbCOa/DlsDScqqLMNRtWklF6jilIPECQzCg0=; b=Z9MjrknpOuPF+pqKLQzqZid8FW3zEaHnhoX5IP5NryC11gEwO7uLcWUhqVJxueC9W6 7CyEpxmwOqnfqxe61a1+dIvuU7OnfHkNIofhb5es+kRTzdzNW0FeLmP3GTVpwKsqCAx9 i/yxgS1SeMvI41chMQEFucT6tmbFzA5SyLmdZGcX8ThN3ccdXUQ0V2MbUttBhZ4aR/uG kTDaZX/9nNor4lMYTgCQTv4GahD7XgYuDxdC8I1g6Qdg9zarXeNsOCuXfRjOpkDCi5/h qT5Y31/7nfG6eQqQ4BRT9zXcgnZPcL68LubYbNrQEx0ABy/gIz0PExjwugqJxjUAo47o hPww== 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:references :mime-version:content-disposition:in-reply-to; bh=/MCv6kGzbCOa/DlsDScqqLMNRtWklF6jilIPECQzCg0=; b=QvejNO47YP5wYEO/3nZjWiZwxcpTK9wPIHdgSP/NAZBCvCCaMAJKah7sWdeyDcZSYg xwF63F0XcPVK3ITmLhgjuUqyGA2ppCffsO3nwO9S+hOFu6EyJLxVrl2Cmg9zOjhhVLiQ BgLS9b6QwkD1a7O2UT0IOaTiMZKeZS/0O4mcVJy8r/RZ5Pup+ESM+8uX1GsZAnWCb5Wu wmb3p/g6zaByBsKL9GMXZrUTNyJu+Nbr2uGmRnsQZjiuREi9t4QIQV2tdgQgg+K9Pibj gq3ooUFXEzVEtD2rAZo27jn0/DFO0vdmzTIktG+0fZYogZvWM7NQeC6xP1YzlIDwBhi8 +HVg== X-Gm-Message-State: AOAM531hW5Rbhc+BS95Hl8xsIBklhRACGgBXMjMBZzaQsiRJM4ktZxCw RN/QQApYoP0oX1PtQb5GfBv5Vg== X-Google-Smtp-Source: ABdhPJwnwOjURbFapQp8v5CLihCKN0iTNY+IAPC8bmYxQUARFNDKMn4DRN3DSrBLnjhBjmyMpFoO8Q== X-Received: by 2002:a17:906:52c2:: with SMTP id w2mr26710730ejn.389.1600272247918; Wed, 16 Sep 2020 09:04:07 -0700 (PDT) Received: from apalos.home (athedsl-246545.home.otenet.gr. [85.73.10.175]) by smtp.gmail.com with ESMTPSA id lc25sm13011774ejb.35.2020.09.16.09.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 09:04:07 -0700 (PDT) Date: Wed, 16 Sep 2020 19:04:04 +0300 From: Ilias Apalodimas To: Will Deacon Subject: Re: [PATCH v2] arm64: bpf: Fix branch offset in JIT Message-ID: <20200916160404.GA153139@apalos.home> References: <20200914160355.19179-1-ilias.apalodimas@linaro.org> <20200915131102.GA26439@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200915131102.GA26439@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_120411_014080_8897D2C6 X-CRM114-Status: GOOD ( 16.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Song Liu , Zi Shen Lim , Alexei Starovoitov , ardb@kernel.org, Jean-Philippe Brucker , Daniel Borkmann , naresh.kamboju@linaro.org, John Fastabend , Catalin Marinas , Jakub Kicinski , Andrii Nakryiko , Jesper Dangaard Brouer , Yonghong Song , KP Singh , linux-arm-kernel@lists.infradead.org, Yauheni Kaliuta , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Jiri Olsa , bpf@vger.kernel.org, Martin KaFai Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Will, On Tue, Sep 15, 2020 at 02:11:03PM +0100, Will Deacon wrote: [...] > > continue; > > } > > - if (ctx->image == NULL) > > - ctx->offset[i] = ctx->idx; > > if (ret) > > return ret; > > } > > + if (ctx->image == NULL) > > + ctx->offset[i] = ctx->idx; > > I think it would be cleared to set ctx->offset[0] before the for loop (with > a comment about what it is) and then change the for loop to iterate from 1 > all the way to prog->len. On a second thought while trying to code this, I'd prefer leaving it as is. First of all we'll have to increase ctx->idx while adding ctx->offset[0] and more importantly, I don't think that's a 'special' case. It's still the same thing i.e the start of the 1st instruction (which happens to be the end of prologue), the next one will be the start of the second instruction etc etc. I don't mind changing if you feel strongly about it, but I think it makese sense as-is. Thanks /Ilias > > Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel