From: dthaler1968@googlemail.com
To: <bpf@ietf.org>, "'bpf'" <bpf@vger.kernel.org>
Cc: "'Alexei Starovoitov'" <alexei.starovoitov@gmail.com>,
"'Jose E. Marchesi'" <jose.marchesi@oracle.com>
Subject: RE: [Bpf] ISA: BPF_CALL | BPF_X
Date: Tue, 6 Feb 2024 08:42:41 -0800 [thread overview]
Message-ID: <0d8301da591b$813d05a0$83b710e0$@gmail.com> (raw)
In-Reply-To: <CAADnVQJDDHEVjrDeXyY+GOncnG+CFY=TBspuZUPzDU6nDLyo9Q@mail.gmail.com>
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> On Tue, Jan 30, 2024 at 11:49 AM Jose E. Marchesi
> <jose.marchesi@oracle.com> wrote:
> > > clang generates BPF code with opcode 0x8d (BPF_CALL | BPF_X, which
> > > it calls "callx"), when compiling with -O0 or -O1. Of course -O2 is
> > > recommended, but if anyone later defines opcode 0x8d for anything
> > > other than what clang means by it, it could cause problems.
> >
> > GCC also generates BPF_CALL|BPF_X also named callx, but only if the
> > experimental -mxbpf option is passed to the compiler.
> >
> > I recommend this particular encoding to be specifically reserved for a
> > future `call REG' for when/if a time comes when the BPF verifier
> > supports some form of indirect calls.
>
> +1.
> Same thinking from llvm pov.
> CALL|X is what we will use when the kernel supports indirect calls.
> I think it means we need to add a 'reserved' category to the spec.
My reading of this thread is that there seems to be consensus that:
1) CALL|X should have an entry in the IANA registry with its own conformance group,
2) The intended meaning is understood,
3) clang and gcc both implement it already with the intended meaning,
4) The Linux kernel might support it someday.
I'd propose we make it its own conformance group called "callx",
which of course the Linux kernel does not yet support, but clang and gcc do.
Rationale:
* There may be other instructions reserved over time in the future so
using a more specific name than just "reserved" is good since later
additions require new groups with different names.
* Defining it now with the meaning already implemented by clang & gcc
means that no changes are needed later once Linux supports it.
* ebpf-for-windows is likely to start supporting it in the very near future
as a result of this thread. There is already a github pull request under
review to add support for it in the PREVAIL verifier.
Dave
WARNING: multiple messages have this Message-ID (diff)
From: dthaler1968=40googlemail.com@dmarc.ietf.org
To: <bpf@ietf.org>, "'bpf'" <bpf@vger.kernel.org>
Cc: "'Alexei Starovoitov'" <alexei.starovoitov@gmail.com>,
"'Jose E. Marchesi'" <jose.marchesi@oracle.com>
Subject: Re: [Bpf] ISA: BPF_CALL | BPF_X
Date: Tue, 6 Feb 2024 08:42:41 -0800 [thread overview]
Message-ID: <0d8301da591b$813d05a0$83b710e0$@gmail.com> (raw)
Message-ID: <20240206164241.nsyYisz5ylaiPoKIwpd1uRCG3PVfI9pgsAsnKECctkk@z> (raw)
In-Reply-To: <CAADnVQJDDHEVjrDeXyY+GOncnG+CFY=TBspuZUPzDU6nDLyo9Q@mail.gmail.com>
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> On Tue, Jan 30, 2024 at 11:49 AM Jose E. Marchesi
> <jose.marchesi@oracle.com> wrote:
> > > clang generates BPF code with opcode 0x8d (BPF_CALL | BPF_X, which
> > > it calls "callx"), when compiling with -O0 or -O1. Of course -O2 is
> > > recommended, but if anyone later defines opcode 0x8d for anything
> > > other than what clang means by it, it could cause problems.
> >
> > GCC also generates BPF_CALL|BPF_X also named callx, but only if the
> > experimental -mxbpf option is passed to the compiler.
> >
> > I recommend this particular encoding to be specifically reserved for a
> > future `call REG' for when/if a time comes when the BPF verifier
> > supports some form of indirect calls.
>
> +1.
> Same thinking from llvm pov.
> CALL|X is what we will use when the kernel supports indirect calls.
> I think it means we need to add a 'reserved' category to the spec.
My reading of this thread is that there seems to be consensus that:
1) CALL|X should have an entry in the IANA registry with its own conformance group,
2) The intended meaning is understood,
3) clang and gcc both implement it already with the intended meaning,
4) The Linux kernel might support it someday.
I'd propose we make it its own conformance group called "callx",
which of course the Linux kernel does not yet support, but clang and gcc do.
Rationale:
* There may be other instructions reserved over time in the future so
using a more specific name than just "reserved" is good since later
additions require new groups with different names.
* Defining it now with the meaning already implemented by clang & gcc
means that no changes are needed later once Linux supports it.
* ebpf-for-windows is likely to start supporting it in the very near future
as a result of this thread. There is already a github pull request under
review to add support for it in the PREVAIL verifier.
Dave
--
Bpf mailing list
Bpf@ietf.org
https://www.ietf.org/mailman/listinfo/bpf
next prev parent reply other threads:[~2024-02-06 16:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 17:27 ISA: BPF_CALL | BPF_X dthaler1968
2024-01-30 17:27 ` [Bpf] " dthaler1968=40googlemail.com
2024-01-30 19:49 ` Jose E. Marchesi
2024-01-30 19:49 ` Jose E. Marchesi
2024-01-30 21:01 ` Alexei Starovoitov
2024-01-30 21:01 ` Alexei Starovoitov
2024-02-06 16:42 ` dthaler1968 [this message]
2024-02-06 16:42 ` dthaler1968=40googlemail.com
2024-02-07 2:11 ` Alexei Starovoitov
2024-02-07 2:11 ` Alexei Starovoitov
2024-02-07 18:39 ` dthaler1968
2024-02-07 18:39 ` dthaler1968=40googlemail.com
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='0d8301da591b$813d05a0$83b710e0$@gmail.com' \
--to=dthaler1968@googlemail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@ietf.org \
--cc=bpf@vger.kernel.org \
--cc=jose.marchesi@oracle.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).