From: Yonghong Song <yhs@meta.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Fangrui Song <maskray@google.com>,
kernel-team@fb.com
Subject: Re: [RFC PATCH bpf-next 01/13] bpf: Support new sign-extension load insns
Date: Mon, 3 Jul 2023 08:29:19 -0700 [thread overview]
Message-ID: <a2ea6493-10df-fe86-a1d6-ebc4e3640ead@meta.com> (raw)
In-Reply-To: <20230703005339.zjljypzmyhh73cfa@MacBook-Pro-8.local>
On 7/2/23 5:53 PM, Alexei Starovoitov wrote:
> On Wed, Jun 28, 2023 at 11:37:21PM -0700, Yonghong Song wrote:
>>
>> +/* LDX: dst_reg = *(s8*)(src_reg + off) */
>> +static void emit_lds(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off)
>> +{
> ...
>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
>> index 60a9d59beeab..b28109bc5c54 100644
>> --- a/include/uapi/linux/bpf.h
>> +++ b/include/uapi/linux/bpf.h
>> @@ -19,6 +19,7 @@
>>
>> /* ld/ldx fields */
>> #define BPF_DW 0x18 /* double word (64-bit) */
>> +#define BPF_MEMS 0x80 /* load with sign extension */
>
> Intel assembly instruction to do sign extending mov is called 'movsx'.
> Let's adopt SX suffix here and in other patches ?
>
> s/BPF_MEMS/BPF_MEMSX/ here.
> s/emit_lds/emit_ldsx/ above.
>
> s/emit_movs_reg/emit_movsx_reg/ in patch 3.
>
> s/bpf_movs_string/bpf_movsx_string/ in patch 7
> s/bpf_lds_string/bpf_ldsx_string/ in patch 7.
> s/is_movs/is_movsx/ in patch 7.
>
> sdiv/smod can stay as-is.
Sounds good to me! Will use the above suggested names
in the next revision.
>
> Naming is hard, of course.
next prev parent reply other threads:[~2023-07-03 15:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 6:37 [RFC PATCH bpf-next 00/13] bpf: Support new insns from cpu v4 Yonghong Song
2023-06-29 6:37 ` [RFC PATCH bpf-next 01/13] bpf: Support new sign-extension load insns Yonghong Song
2023-07-03 0:53 ` Alexei Starovoitov
2023-07-03 15:29 ` Yonghong Song [this message]
2023-06-29 6:37 ` [RFC PATCH bpf-next 02/13] bpf: Add verifier support for " Yonghong Song
2023-06-29 6:37 ` [RFC PATCH bpf-next 03/13] bpf: Support new sign-extension mov insns Yonghong Song
2023-06-29 6:37 ` [RFC PATCH bpf-next 04/13] bpf: Support new unconditional bswap instruction Yonghong Song
2023-06-29 6:37 ` [RFC PATCH bpf-next 05/13] bpf: Support new signed div/mod instructions Yonghong Song
2023-06-29 6:37 ` [RFC PATCH bpf-next 06/13] bpf: Support new 32bit offset jmp instruction Yonghong Song
2023-06-29 6:37 ` [RFC PATCH bpf-next 07/13] bpf: Add kernel/bpftool asm support for new instructions Yonghong Song
2023-06-29 6:38 ` [RFC PATCH bpf-next 08/13] selftests/bpf: Add unit tests for new sign-extension load insns Yonghong Song
2023-06-29 6:38 ` [RFC PATCH bpf-next 09/13] selftests/bpf: Add unit tests for new sign-extension mov insns Yonghong Song
2023-06-29 6:38 ` [RFC PATCH bpf-next 10/13] selftests/bpf: Add unit tests for new bswap insns Yonghong Song
2023-06-29 6:38 ` [RFC PATCH bpf-next 11/13] selftests/bpf: Add unit tests for new sdiv/smod insns Yonghong Song
2023-06-29 6:38 ` [RFC PATCH bpf-next 12/13] selftests/bpf: Add unit tests for new gotol insn Yonghong Song
2023-06-29 6:38 ` [RFC PATCH bpf-next 13/13] selftests/bpf: Add a cpuv4 test runner for cpu=v4 testing Yonghong Song
[not found] ` <PH7PR21MB38786422B9929D253E279810A325A@PH7PR21MB3878.namprd21.prod.outlook.com>
2023-06-29 14:17 ` [RFC PATCH bpf-next 00/13] bpf: Support new insns from cpu v4 Yonghong Song
2023-07-03 21:11 ` Daniel Xu
2023-07-03 23:36 ` 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=a2ea6493-10df-fe86-a1d6-ebc4e3640ead@meta.com \
--to=yhs@meta.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=maskray@google.com \
--cc=yhs@fb.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