* [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
@ 2024-01-18 23:29 Dave Thaler
2024-01-18 23:29 ` [Bpf] " Dave Thaler
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Dave Thaler @ 2024-01-18 23:29 UTC (permalink / raw)
To: bpf; +Cc: bpf, Dave Thaler
Per discussion on the mailing list at
https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
the MOVSX operation is only defined to support register extension.
The document didn't previously state this and incorrectly implied
that one could use an immediate value.
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
---
Documentation/bpf/standardization/instruction-set.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index eb0f234a8..d17a96c62 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -317,7 +317,8 @@ The ``BPF_MOVSX`` instruction does a move operation with sign extension.
``BPF_ALU | BPF_MOVSX`` :term:`sign extends<Sign Extend>` 8-bit and 16-bit operands into 32
bit operands, and zeroes the remaining upper 32 bits.
``BPF_ALU64 | BPF_MOVSX`` :term:`sign extends<Sign Extend>` 8-bit, 16-bit, and 32-bit
-operands into 64 bit operands.
+operands into 64 bit operands. Unlike other arithmetic instructions,
+``BPF_MOVSX`` is only defined for register source operands (``BPF_X``).
Shift operations use a mask of 0x3F (63) for 64-bit operations and 0x1F (31)
for 32-bit operations.
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Bpf] [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
2024-01-18 23:29 [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K Dave Thaler
@ 2024-01-18 23:29 ` Dave Thaler
2024-01-18 23:45 ` David Vernet
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Dave Thaler @ 2024-01-18 23:29 UTC (permalink / raw)
To: bpf; +Cc: bpf, Dave Thaler
Per discussion on the mailing list at
https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
the MOVSX operation is only defined to support register extension.
The document didn't previously state this and incorrectly implied
that one could use an immediate value.
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
---
Documentation/bpf/standardization/instruction-set.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index eb0f234a8..d17a96c62 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -317,7 +317,8 @@ The ``BPF_MOVSX`` instruction does a move operation with sign extension.
``BPF_ALU | BPF_MOVSX`` :term:`sign extends<Sign Extend>` 8-bit and 16-bit operands into 32
bit operands, and zeroes the remaining upper 32 bits.
``BPF_ALU64 | BPF_MOVSX`` :term:`sign extends<Sign Extend>` 8-bit, 16-bit, and 32-bit
-operands into 64 bit operands.
+operands into 64 bit operands. Unlike other arithmetic instructions,
+``BPF_MOVSX`` is only defined for register source operands (``BPF_X``).
Shift operations use a mask of 0x3F (63) for 64-bit operations and 0x1F (31)
for 32-bit operations.
--
2.40.1
--
Bpf mailing list
Bpf@ietf.org
https://www.ietf.org/mailman/listinfo/bpf
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Bpf] [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
2024-01-18 23:29 [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K Dave Thaler
2024-01-18 23:29 ` [Bpf] " Dave Thaler
@ 2024-01-18 23:45 ` David Vernet
2024-01-18 23:45 ` David Vernet
2024-01-18 23:53 ` Yonghong Song
2024-01-23 23:40 ` patchwork-bot+netdevbpf
3 siblings, 1 reply; 7+ messages in thread
From: David Vernet @ 2024-01-18 23:45 UTC (permalink / raw)
To: Dave Thaler; +Cc: bpf, bpf, Dave Thaler
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
On Thu, Jan 18, 2024 at 03:29:54PM -0800, Dave Thaler wrote:
> Per discussion on the mailing list at
> https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
> the MOVSX operation is only defined to support register extension.
>
> The document didn't previously state this and incorrectly implied
> that one could use an immediate value.
>
> Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Acked-by: David Vernet <void@manifault.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bpf] [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
2024-01-18 23:45 ` David Vernet
@ 2024-01-18 23:45 ` David Vernet
0 siblings, 0 replies; 7+ messages in thread
From: David Vernet @ 2024-01-18 23:45 UTC (permalink / raw)
To: Dave Thaler; +Cc: bpf, bpf, Dave Thaler
[-- Attachment #1.1: Type: text/plain, Size: 467 bytes --]
On Thu, Jan 18, 2024 at 03:29:54PM -0800, Dave Thaler wrote:
> Per discussion on the mailing list at
> https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
> the MOVSX operation is only defined to support register extension.
>
> The document didn't previously state this and incorrectly implied
> that one could use an immediate value.
>
> Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Acked-by: David Vernet <void@manifault.com>
[-- 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bpf] [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
2024-01-18 23:29 [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K Dave Thaler
2024-01-18 23:29 ` [Bpf] " Dave Thaler
2024-01-18 23:45 ` David Vernet
@ 2024-01-18 23:53 ` Yonghong Song
2024-01-18 23:53 ` Yonghong Song
2024-01-23 23:40 ` patchwork-bot+netdevbpf
3 siblings, 1 reply; 7+ messages in thread
From: Yonghong Song @ 2024-01-18 23:53 UTC (permalink / raw)
To: Dave Thaler, bpf; +Cc: bpf, Dave Thaler
On 1/18/24 3:29 PM, Dave Thaler wrote:
> Per discussion on the mailing list at
> https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
> the MOVSX operation is only defined to support register extension.
>
> The document didn't previously state this and incorrectly implied
> that one could use an immediate value.
>
> Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bpf] [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
2024-01-18 23:53 ` Yonghong Song
@ 2024-01-18 23:53 ` Yonghong Song
0 siblings, 0 replies; 7+ messages in thread
From: Yonghong Song @ 2024-01-18 23:53 UTC (permalink / raw)
To: Dave Thaler, bpf; +Cc: bpf, Dave Thaler
On 1/18/24 3:29 PM, Dave Thaler wrote:
> Per discussion on the mailing list at
> https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
> the MOVSX operation is only defined to support register extension.
>
> The document didn't previously state this and incorrectly implied
> that one could use an immediate value.
>
> Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
--
Bpf mailing list
Bpf@ietf.org
https://www.ietf.org/mailman/listinfo/bpf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
2024-01-18 23:29 [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K Dave Thaler
` (2 preceding siblings ...)
2024-01-18 23:53 ` Yonghong Song
@ 2024-01-23 23:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-23 23:40 UTC (permalink / raw)
To: Dave Thaler; +Cc: bpf, bpf, dthaler1968
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Thu, 18 Jan 2024 15:29:54 -0800 you wrote:
> Per discussion on the mailing list at
> https://mailarchive.ietf.org/arch/msg/bpf/uQiqhURdtxV_ZQOTgjCdm-seh74/
> the MOVSX operation is only defined to support register extension.
>
> The document didn't previously state this and incorrectly implied
> that one could use an immediate value.
>
> [...]
Here is the summary with links:
- [bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K
https://git.kernel.org/bpf/bpf-next/c/20e109ea9842
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-01-23 23:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 23:29 [PATCH bpf-next] bpf, docs: Clarify that MOVSX is only for BPF_X not BPF_K Dave Thaler
2024-01-18 23:29 ` [Bpf] " Dave Thaler
2024-01-18 23:45 ` David Vernet
2024-01-18 23:45 ` David Vernet
2024-01-18 23:53 ` Yonghong Song
2024-01-18 23:53 ` Yonghong Song
2024-01-23 23:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox