All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vernet <void@manifault.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Dave Thaler <dthaler1968@googlemail.com>,
	bpf@ietf.org, bpf <bpf@vger.kernel.org>,
	"Jose E. Marchesi" <jose.marchesi@oracle.com>
Subject: Re: [Bpf] Standardizing BPF assembly language?
Date: Fri, 26 Jan 2024 23:29:39 -0600	[thread overview]
Message-ID: <20240127052939.GA31099@maniforge> (raw)
In-Reply-To: <CAADnVQLFc+32+5yTrONYhw-HGheYRK2nSEgMoteXdwc_Q2Tw1Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2325 bytes --]

On Wed, Jan 24, 2024 at 06:51:16PM -0800, Alexei Starovoitov wrote:
> On Tue, Jan 23, 2024 at 1:52 PM David Vernet <void@manifault.com> wrote:
> > > > > A second question would be, which dialect(s) to standardize.  Jose's
> > > > > link above argues that the second dialect should be the one
> > > > > standardized (tools are free to support multiple dialects for
> > > > > backwards compat if they want).  See the link for rationale.
> > > >
> > > > My recollection was that the outcome of that discussion is that we were
> > > going
> > > > to continue to support both. If we wanted to standardize, I have a hard
> > > time
> > > > seeing any other way other than to standardize both dialects unless
> > > there's
> > > > been a significant change in sentiment since LSFMM.
> > >
> > > If "standardize both", does that mean neither is mandatory and each tool
> > > is free to pick one or the other?  And would the IANA registry require a
> > > document
> > > adding any new instructions to specify the assembly in both dialects?
> >
> > Well, if we're standardizing on both, then yes I think it would be
> > mandatory for a tool to support both, and I think instructions would
> > require assembly for both dialects.
> 
> I think it's obvious that there is no way we will add gcc's flavor
> of asm to kernel and llvm.

Well, it will depend on how widely it's used. Or if it's used widely :-)

> > Practically speaking that's already
> > what's happening, no? Both dialects are already pervasive,
> 
> They are not. There are thousands of lines of asm written in pseudo-c
> used in production applications and probably only ubpf/tests and gcc/tests
> in that other asm, since gcc bpf support is not yet in the released gcc version.
> 
> There is also this asm flavor:
> https://github.com/Xilinx-CNS/ebpf_asm
> 
> Which is different from pseudo-c and ubpf asm.
> 
> I don't think asm syntax should be an IETF draft.

Ok, fair enough. Another thought that occurred to me after thinking
about this more -- even if we want source code compatibility (which is
still an open question), that doesn't necessarily imply or require
assembly dialect compatibility. Let's table this for now, and revisit
another day, should we ever find that it makes sense to do so.

Thanks,
David

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: David Vernet <void@manifault.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Dave Thaler <dthaler1968@googlemail.com>,
	bpf@ietf.org, bpf <bpf@vger.kernel.org>,
	"Jose E. Marchesi" <jose.marchesi@oracle.com>
Subject: Re: [Bpf] Standardizing BPF assembly language?
Date: Fri, 26 Jan 2024 23:29:39 -0600	[thread overview]
Message-ID: <20240127052939.GA31099@maniforge> (raw)
Message-ID: <20240127052939.VetNQVK5b0WwCEeTq8F0Efh463OR_VHylcGKOMOKCko@z> (raw)
In-Reply-To: <CAADnVQLFc+32+5yTrONYhw-HGheYRK2nSEgMoteXdwc_Q2Tw1Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2325 bytes --]

On Wed, Jan 24, 2024 at 06:51:16PM -0800, Alexei Starovoitov wrote:
> On Tue, Jan 23, 2024 at 1:52 PM David Vernet <void@manifault.com> wrote:
> > > > > A second question would be, which dialect(s) to standardize.  Jose's
> > > > > link above argues that the second dialect should be the one
> > > > > standardized (tools are free to support multiple dialects for
> > > > > backwards compat if they want).  See the link for rationale.
> > > >
> > > > My recollection was that the outcome of that discussion is that we were
> > > going
> > > > to continue to support both. If we wanted to standardize, I have a hard
> > > time
> > > > seeing any other way other than to standardize both dialects unless
> > > there's
> > > > been a significant change in sentiment since LSFMM.
> > >
> > > If "standardize both", does that mean neither is mandatory and each tool
> > > is free to pick one or the other?  And would the IANA registry require a
> > > document
> > > adding any new instructions to specify the assembly in both dialects?
> >
> > Well, if we're standardizing on both, then yes I think it would be
> > mandatory for a tool to support both, and I think instructions would
> > require assembly for both dialects.
> 
> I think it's obvious that there is no way we will add gcc's flavor
> of asm to kernel and llvm.

Well, it will depend on how widely it's used. Or if it's used widely :-)

> > Practically speaking that's already
> > what's happening, no? Both dialects are already pervasive,
> 
> They are not. There are thousands of lines of asm written in pseudo-c
> used in production applications and probably only ubpf/tests and gcc/tests
> in that other asm, since gcc bpf support is not yet in the released gcc version.
> 
> There is also this asm flavor:
> https://github.com/Xilinx-CNS/ebpf_asm
> 
> Which is different from pseudo-c and ubpf asm.
> 
> I don't think asm syntax should be an IETF draft.

Ok, fair enough. Another thought that occurred to me after thinking
about this more -- even if we want source code compatibility (which is
still an open question), that doesn't necessarily imply or require
assembly dialect compatibility. Let's table this for now, and revisit
another day, should we ever find that it makes sense to do so.

Thanks,
David

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 76 bytes --]

-- 
Bpf mailing list
Bpf@ietf.org
https://www.ietf.org/mailman/listinfo/bpf

  reply	other threads:[~2024-01-27  5:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 16:45 Standardizing BPF assembly language? dthaler1968
2024-01-23 16:45 ` [Bpf] " dthaler1968=40googlemail.com
2024-01-23 21:31 ` David Vernet
2024-01-23 21:31   ` David Vernet
2024-01-23 21:41   ` dthaler1968
2024-01-23 21:41     ` dthaler1968=40googlemail.com
2024-01-23 21:52     ` David Vernet
2024-01-23 21:52       ` David Vernet
2024-01-23 23:15       ` dthaler1968
2024-01-23 23:15         ` dthaler1968=40googlemail.com
2024-01-25  2:51       ` Alexei Starovoitov
2024-01-25  2:51         ` Alexei Starovoitov
2024-01-27  5:29         ` David Vernet [this message]
2024-01-27  5:29           ` David Vernet
2024-01-25  3:13 ` Watson Ladd
2024-01-25  3:13   ` Watson Ladd

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=20240127052939.GA31099@maniforge \
    --to=void@manifault.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@ietf.org \
    --cc=bpf@vger.kernel.org \
    --cc=dthaler1968@googlemail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.