From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Will Deacon <will@kernel.org>
Cc: bpf@vger.kernel.org, ardb@kernel.org, naresh.kamboju@linaro.org,
Jiri Olsa <jolsa@kernel.org>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Yauheni Kaliuta <yauheni.kaliuta@redhat.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
Zi Shen Lim <zlim.lnx@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] arm64: bpf: Fix branch offset in JIT
Date: Wed, 16 Sep 2020 19:04:04 +0300 [thread overview]
Message-ID: <20200916160404.GA153139@apalos.home> (raw)
In-Reply-To: <20200915131102.GA26439@willie-the-truck>
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
prev parent reply other threads:[~2020-09-16 21:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 16:03 [PATCH v2] arm64: bpf: Fix branch offset in JIT Ilias Apalodimas
2020-09-15 13:11 ` Will Deacon
2020-09-15 13:53 ` Ilias Apalodimas
2020-09-15 14:17 ` Will Deacon
2020-09-15 19:23 ` Ilias Apalodimas
2020-09-16 12:39 ` Yauheni Kaliuta
2020-09-16 13:17 ` Jean-Philippe Brucker
2020-09-16 13:45 ` Yauheni Kaliuta
2020-09-15 13:54 ` Jean-Philippe Brucker
2020-09-16 16:04 ` Ilias Apalodimas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200916160404.GA153139@apalos.home \
--to=ilias.apalodimas@linaro.org \
--cc=andriin@fb.com \
--cc=ardb@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=jean-philippe@linaro.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=will@kernel.org \
--cc=yauheni.kaliuta@redhat.com \
--cc=yhs@fb.com \
--cc=zlim.lnx@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).