All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: dthaler1968@googlemail.com,
	'Dave Thaler' <dthaler1968=40googlemail.com@dmarc.ietf.org>,
	bpf@vger.kernel.org, bpf@ietf.org
Subject: Re: [Bpf] [PATCH bpf-next v2] bpf, docs: Add callx instructions in new conformance group
Date: Tue, 13 Feb 2024 07:11:05 +0100	[thread overview]
Message-ID: <87zfw4sxl2.fsf@oracle.com> (raw)
In-Reply-To: <a81da29b-b671-484a-8f3d-743f1dac44f1@linux.dev> (Yonghong Song's message of "Mon, 12 Feb 2024 14:48:53 -0800")


> On 2/12/24 1:52 PM, dthaler1968@googlemail.com wrote:
>>> -----Original Message-----
>>> From: Yonghong Song <yonghong.song@linux.dev>
>>> Sent: Monday, February 12, 2024 1:49 PM
>>> To: Jose E. Marchesi <jose.marchesi@oracle.com>; Dave Thaler
>>> <dthaler1968=40googlemail.com@dmarc.ietf.org>
>>> Cc: bpf@vger.kernel.org; bpf@ietf.org; Dave Thaler
>>> <dthaler1968@gmail.com>
>>> Subject: Re: [Bpf] [PATCH bpf-next v2] bpf, docs: Add callx instructions in new
>>> conformance group
>>>
>>>
>>> On 2/12/24 1:28 PM, Jose E. Marchesi wrote:
>>>>> +BPF_CALL  0x8    0x1  call PC += reg_val(imm)          BPF_JMP | BPF_X
>>> only, see `Program-local functions`_
>>>> If the instruction requires a register operand, why not using one of
>>>> the register fields?  Is there any reason for not doing that?
>>> Talked to Alexei and we think using dst_reg for the register for callx insn is
>>> better. I will craft a llvm patch for this today. Thanks!
>> Why dst_reg instead of src_reg?
>> BPF_X is supposed to mean use src_reg.
>
> Let us use dst_reg. Currently, for BPF_K, we have src_reg for a bunch
> of flags (pseudo call, kfunc call, etc.). So for BPF_X, let us preserve this
> property as well in case in the future we will introduce variants for
> callx. The following is the llvm diff:
>
> https://github.com/llvm/llvm-project/pull/81546

Thank you.

I believe Will will be sending a patch to binutils to change the
pseudo-C syntax for the instruction to callx instead of callr.  We will
then adapt GCC accordingly, and both compilers will be doing exactly the
same regarding callx.

>>
>> But this thread is about reserving/documenting the existing practice,
>> since anyone trying to use it would run into interop issues because
>> of existing clang.   Should we document both and list one as deprecated?
>
> I think just documenting the new encoding is good enough. But other
> people can chime in just in case that I missed something.
>
>>
>> Dave
>>

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

WARNING: multiple messages have this Message-ID (diff)
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: dthaler1968@googlemail.com,
	'Dave Thaler' <dthaler1968=40googlemail.com@dmarc.ietf.org>,
	bpf@vger.kernel.org, bpf@ietf.org
Subject: Re: [Bpf] [PATCH bpf-next v2] bpf, docs: Add callx instructions in new conformance group
Date: Tue, 13 Feb 2024 07:11:05 +0100	[thread overview]
Message-ID: <87zfw4sxl2.fsf@oracle.com> (raw)
Message-ID: <20240213061105.t1m2RnW24NMc1Z2VOzAZWN6cgvnhxdf7WTM8uBEgUxQ@z> (raw)
In-Reply-To: <a81da29b-b671-484a-8f3d-743f1dac44f1@linux.dev> (Yonghong Song's message of "Mon, 12 Feb 2024 14:48:53 -0800")


> On 2/12/24 1:52 PM, dthaler1968@googlemail.com wrote:
>>> -----Original Message-----
>>> From: Yonghong Song <yonghong.song@linux.dev>
>>> Sent: Monday, February 12, 2024 1:49 PM
>>> To: Jose E. Marchesi <jose.marchesi@oracle.com>; Dave Thaler
>>> <dthaler1968=40googlemail.com@dmarc.ietf.org>
>>> Cc: bpf@vger.kernel.org; bpf@ietf.org; Dave Thaler
>>> <dthaler1968@gmail.com>
>>> Subject: Re: [Bpf] [PATCH bpf-next v2] bpf, docs: Add callx instructions in new
>>> conformance group
>>>
>>>
>>> On 2/12/24 1:28 PM, Jose E. Marchesi wrote:
>>>>> +BPF_CALL  0x8    0x1  call PC += reg_val(imm)          BPF_JMP | BPF_X
>>> only, see `Program-local functions`_
>>>> If the instruction requires a register operand, why not using one of
>>>> the register fields?  Is there any reason for not doing that?
>>> Talked to Alexei and we think using dst_reg for the register for callx insn is
>>> better. I will craft a llvm patch for this today. Thanks!
>> Why dst_reg instead of src_reg?
>> BPF_X is supposed to mean use src_reg.
>
> Let us use dst_reg. Currently, for BPF_K, we have src_reg for a bunch
> of flags (pseudo call, kfunc call, etc.). So for BPF_X, let us preserve this
> property as well in case in the future we will introduce variants for
> callx. The following is the llvm diff:
>
> https://github.com/llvm/llvm-project/pull/81546

Thank you.

I believe Will will be sending a patch to binutils to change the
pseudo-C syntax for the instruction to callx instead of callr.  We will
then adapt GCC accordingly, and both compilers will be doing exactly the
same regarding callx.

>>
>> But this thread is about reserving/documenting the existing practice,
>> since anyone trying to use it would run into interop issues because
>> of existing clang.   Should we document both and list one as deprecated?
>
> I think just documenting the new encoding is good enough. But other
> people can chime in just in case that I missed something.
>
>>
>> Dave
>>

  parent reply	other threads:[~2024-02-13  6:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 21:13 [PATCH bpf-next v2] bpf, docs: Add callx instructions in new conformance group Dave Thaler
2024-02-12 21:13 ` [Bpf] " Dave Thaler
2024-02-12 21:21 ` David Vernet
2024-02-12 21:21   ` David Vernet
2024-02-12 21:28 ` Jose E. Marchesi
2024-02-12 21:28   ` Jose E. Marchesi
2024-02-12 21:46   ` dthaler1968
2024-02-12 21:46     ` dthaler1968=40googlemail.com
2024-02-12 21:49   ` Yonghong Song
2024-02-12 21:49     ` Yonghong Song
2024-02-12 21:52     ` dthaler1968
2024-02-12 21:52       ` dthaler1968=40googlemail.com
2024-02-12 22:48       ` Yonghong Song
2024-02-12 22:48         ` Yonghong Song
2024-02-13  1:18         ` dthaler1968
2024-02-13  1:18           ` dthaler1968=40googlemail.com
2024-02-13  1:23           ` Yonghong Song
2024-02-13  1:23             ` Yonghong Song
2024-02-13  6:11         ` Jose E. Marchesi [this message]
2024-02-13  6:11           ` Jose E. Marchesi

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=87zfw4sxl2.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=bpf@ietf.org \
    --cc=bpf@vger.kernel.org \
    --cc=dthaler1968=40googlemail.com@dmarc.ietf.org \
    --cc=dthaler1968@googlemail.com \
    --cc=yonghong.song@linux.dev \
    /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.