public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: "Jose E. Marchesi" <jose.marchesi@oracle.com>
Cc: Yonghong Song <yhs@meta.com>, bpf@vger.kernel.org
Subject: Re: Encoding of V4 32-bit JA
Date: Sun, 23 Jul 2023 22:21:19 +0300	[thread overview]
Message-ID: <ee97e19d73fa460bc37004baf01bd5f9fe6f67b4.camel@gmail.com> (raw)
In-Reply-To: <878rb6qw2h.fsf@oracle.com>

On Sun, 2023-07-23 at 21:14 +0200, Jose E. Marchesi wrote:
> > On Fri, 2023-07-21 at 18:19 +0200, Jose E. Marchesi wrote:
> > > Hi Yonghong.
> > > 
> > > This is from the v4 instructions proposal:
> > > 
> > >     ========  =====  =========================  ============
> > >     code      value  description                notes
> > >     ========  =====  =========================  ============
> > >     BPF_JA    0x00   PC += imm                  BPF_JMP32 only
> > > 
> > > Is this instruction using source 1 instead of 0?  Otherwise, it would
> > > have exactly the same encoding than the V3< JA instruction.  Is that
> > > what is intended?
> > > 
> > > TIA.
> > > 
> > 
> > Hi Jose,
> > 
> > I think that assumption is that `BPF_JMP32 | BPF_JA` is currently free:
> > - documentation [1] implies that only `BPF_JMP` should be used for `BPF_JA`
> >   (see "notes" column for the first line)
> > - BPF verifier rejects `BPF_JMP32 | BPF_JA`
> > - clang always generates `BPF_JMP | BPF_JA`
> 
> Makes sense, thanks for the info.
> 
> Do you know the precise pseudo-c assembly syntax to use for this
> instruction?

In [1] Yonghong uses the following form:

  gotol +0xcd9b

But it seems to be not specified in the documentation for the patch-set v3.

[1] https://reviews.llvm.org/D144829

> 
> > Thanks,
> > Eduard
> > 
> > [1] https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#jump-instructions


  reply	other threads:[~2023-07-23 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 16:19 Encoding of V4 32-bit JA Jose E. Marchesi
2023-07-23 17:10 ` Eduard Zingerman
2023-07-23 19:14   ` Jose E. Marchesi
2023-07-23 19:21     ` Eduard Zingerman [this message]
2023-07-23 19:57       ` Jose E. Marchesi
2023-07-23 23:51         ` Jose E. Marchesi
2023-07-24  2:37       ` Yonghong Song

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=ee97e19d73fa460bc37004baf01bd5f9fe6f67b4.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=jose.marchesi@oracle.com \
    --cc=yhs@meta.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