* Encoding of V4 32-bit JA
@ 2023-07-21 16:19 Jose E. Marchesi
2023-07-23 17:10 ` Eduard Zingerman
0 siblings, 1 reply; 7+ messages in thread
From: Jose E. Marchesi @ 2023-07-21 16:19 UTC (permalink / raw)
To: Yonghong Song; +Cc: bpf
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Encoding of V4 32-bit JA
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
0 siblings, 1 reply; 7+ messages in thread
From: Eduard Zingerman @ 2023-07-23 17:10 UTC (permalink / raw)
To: Jose E. Marchesi, Yonghong Song; +Cc: bpf
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`
Thanks,
Eduard
[1] https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#jump-instructions
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Encoding of V4 32-bit JA
2023-07-23 17:10 ` Eduard Zingerman
@ 2023-07-23 19:14 ` Jose E. Marchesi
2023-07-23 19:21 ` Eduard Zingerman
0 siblings, 1 reply; 7+ messages in thread
From: Jose E. Marchesi @ 2023-07-23 19:14 UTC (permalink / raw)
To: Eduard Zingerman; +Cc: Yonghong Song, bpf
> 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?
> Thanks,
> Eduard
>
> [1] https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#jump-instructions
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Encoding of V4 32-bit JA
2023-07-23 19:14 ` Jose E. Marchesi
@ 2023-07-23 19:21 ` Eduard Zingerman
2023-07-23 19:57 ` Jose E. Marchesi
2023-07-24 2:37 ` Yonghong Song
0 siblings, 2 replies; 7+ messages in thread
From: Eduard Zingerman @ 2023-07-23 19:21 UTC (permalink / raw)
To: Jose E. Marchesi; +Cc: Yonghong Song, bpf
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Encoding of V4 32-bit JA
2023-07-23 19:21 ` Eduard Zingerman
@ 2023-07-23 19:57 ` Jose E. Marchesi
2023-07-23 23:51 ` Jose E. Marchesi
2023-07-24 2:37 ` Yonghong Song
1 sibling, 1 reply; 7+ messages in thread
From: Jose E. Marchesi @ 2023-07-23 19:57 UTC (permalink / raw)
To: Eduard Zingerman; +Cc: Yonghong Song, bpf
> 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.
I will use that syntax in binutils for now.
> [1] https://reviews.llvm.org/D144829
>
>>
>> > Thanks,
>> > Eduard
>> >
>> > [1] https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#jump-instructions
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Encoding of V4 32-bit JA
2023-07-23 19:57 ` Jose E. Marchesi
@ 2023-07-23 23:51 ` Jose E. Marchesi
0 siblings, 0 replies; 7+ messages in thread
From: Jose E. Marchesi @ 2023-07-23 23:51 UTC (permalink / raw)
To: Eduard Zingerman; +Cc: Yonghong Song, bpf
>> 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.
>
> I will use that syntax in binutils for now.
https://sourceware.org/pipermail/binutils/2023-July/128543.html
Now we will make GCC to use that instruction whenever needed, but only
with -mcpu=v4 or later:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110781
>> [1] https://reviews.llvm.org/D144829
>>
>>>
>>> > Thanks,
>>> > Eduard
>>> >
>>> > [1] https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#jump-instructions
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Encoding of V4 32-bit JA
2023-07-23 19:21 ` Eduard Zingerman
2023-07-23 19:57 ` Jose E. Marchesi
@ 2023-07-24 2:37 ` Yonghong Song
1 sibling, 0 replies; 7+ messages in thread
From: Yonghong Song @ 2023-07-24 2:37 UTC (permalink / raw)
To: Eduard Zingerman, Jose E. Marchesi; +Cc: bpf
On 7/23/23 12:21 PM, Eduard Zingerman wrote:
> 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.
Thanks Eduard, I will add gotol to the documentation.
>
> [1] https://reviews.llvm.org/D144829
>
>>
>>> Thanks,
>>> Eduard
>>>
>>> [1] https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#jump-instructions
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-07-24 2:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-07-23 19:57 ` Jose E. Marchesi
2023-07-23 23:51 ` Jose E. Marchesi
2023-07-24 2:37 ` Yonghong Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox