* [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst
@ 2024-04-26 23:11 Dave Thaler
2024-04-26 23:11 ` [Bpf] " Dave Thaler
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dave Thaler @ 2024-04-26 23:11 UTC (permalink / raw)
To: bpf; +Cc: bpf, Dave Thaler, Dave Thaler
This patch elaborates on the use of PC by expanding the PC acronym,
explaining the units, and the relative position to which the offset
applies.
v1->v2: reword per feedback from Alexei
v2->v3: reword per feedback from David Vernet
Signed-off-by: Dave Thaler <dthaler1968@googlemail.com>
---
Documentation/bpf/standardization/instruction-set.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index b44bdacd0..997560aba 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -469,6 +469,12 @@ JSLT 0xc any PC += offset if dst < src signed
JSLE 0xd any PC += offset if dst <= src signed
======== ===== ======= ================================= ===================================================
+where 'PC' denotes the program counter, and the offset to increment by
+is in units of 64-bit instructions relative to the instruction following
+the jump instruction. Thus 'PC += 1' skips execution of the next
+instruction if it's a basic instruction or results in undefined behavior
+if the next instruction is a 128-bit wide instruction.
+
The BPF program needs to store the return value into register R0 before doing an
``EXIT``.
--
2.40.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Bpf] [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst
2024-04-26 23:11 [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst Dave Thaler
@ 2024-04-26 23:11 ` Dave Thaler
2024-04-28 22:01 ` David Vernet
2024-04-29 10:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Dave Thaler @ 2024-04-26 23:11 UTC (permalink / raw)
To: bpf; +Cc: bpf, Dave Thaler, Dave Thaler
This patch elaborates on the use of PC by expanding the PC acronym,
explaining the units, and the relative position to which the offset
applies.
v1->v2: reword per feedback from Alexei
v2->v3: reword per feedback from David Vernet
Signed-off-by: Dave Thaler <dthaler1968@googlemail.com>
---
Documentation/bpf/standardization/instruction-set.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index b44bdacd0..997560aba 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -469,6 +469,12 @@ JSLT 0xc any PC += offset if dst < src signed
JSLE 0xd any PC += offset if dst <= src signed
======== ===== ======= ================================= ===================================================
+where 'PC' denotes the program counter, and the offset to increment by
+is in units of 64-bit instructions relative to the instruction following
+the jump instruction. Thus 'PC += 1' skips execution of the next
+instruction if it's a basic instruction or results in undefined behavior
+if the next instruction is a 128-bit wide instruction.
+
The BPF program needs to store the return value into register R0 before doing an
``EXIT``.
--
2.40.1
--
Bpf mailing list
Bpf@ietf.org
https://www.ietf.org/mailman/listinfo/bpf
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Bpf] [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst
2024-04-26 23:11 [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst Dave Thaler
2024-04-26 23:11 ` [Bpf] " Dave Thaler
@ 2024-04-28 22:01 ` David Vernet
2024-04-28 22:01 ` David Vernet
2024-04-29 10:00 ` patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: David Vernet @ 2024-04-28 22:01 UTC (permalink / raw)
To: Dave Thaler; +Cc: bpf, bpf, Dave Thaler, Dave Thaler
[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]
On Fri, Apr 26, 2024 at 04:11:26PM -0700, Dave Thaler wrote:
> This patch elaborates on the use of PC by expanding the PC acronym,
> explaining the units, and the relative position to which the offset
> applies.
>
> v1->v2: reword per feedback from Alexei
>
> v2->v3: reword per feedback from David Vernet
>
> Signed-off-by: Dave Thaler <dthaler1968@googlemail.com>
Reviewed-by: David Vernet <void@manifault.com>
> ---
> Documentation/bpf/standardization/instruction-set.rst | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
> index b44bdacd0..997560aba 100644
> --- a/Documentation/bpf/standardization/instruction-set.rst
> +++ b/Documentation/bpf/standardization/instruction-set.rst
> @@ -469,6 +469,12 @@ JSLT 0xc any PC += offset if dst < src signed
> JSLE 0xd any PC += offset if dst <= src signed
> ======== ===== ======= ================================= ===================================================
>
> +where 'PC' denotes the program counter, and the offset to increment by
> +is in units of 64-bit instructions relative to the instruction following
> +the jump instruction. Thus 'PC += 1' skips execution of the next
> +instruction if it's a basic instruction or results in undefined behavior
> +if the next instruction is a 128-bit wide instruction.
> +
> The BPF program needs to store the return value into register R0 before doing an
> ``EXIT``.
>
> --
> 2.40.1
>
> --
> Bpf mailing list
> Bpf@ietf.org
> https://www.ietf.org/mailman/listinfo/bpf
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bpf] [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst
2024-04-28 22:01 ` David Vernet
@ 2024-04-28 22:01 ` David Vernet
0 siblings, 0 replies; 5+ messages in thread
From: David Vernet @ 2024-04-28 22:01 UTC (permalink / raw)
To: Dave Thaler; +Cc: bpf, bpf, Dave Thaler, Dave Thaler
[-- Attachment #1.1: Type: text/plain, Size: 1698 bytes --]
On Fri, Apr 26, 2024 at 04:11:26PM -0700, Dave Thaler wrote:
> This patch elaborates on the use of PC by expanding the PC acronym,
> explaining the units, and the relative position to which the offset
> applies.
>
> v1->v2: reword per feedback from Alexei
>
> v2->v3: reword per feedback from David Vernet
>
> Signed-off-by: Dave Thaler <dthaler1968@googlemail.com>
Reviewed-by: David Vernet <void@manifault.com>
> ---
> Documentation/bpf/standardization/instruction-set.rst | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
> index b44bdacd0..997560aba 100644
> --- a/Documentation/bpf/standardization/instruction-set.rst
> +++ b/Documentation/bpf/standardization/instruction-set.rst
> @@ -469,6 +469,12 @@ JSLT 0xc any PC += offset if dst < src signed
> JSLE 0xd any PC += offset if dst <= src signed
> ======== ===== ======= ================================= ===================================================
>
> +where 'PC' denotes the program counter, and the offset to increment by
> +is in units of 64-bit instructions relative to the instruction following
> +the jump instruction. Thus 'PC += 1' skips execution of the next
> +instruction if it's a basic instruction or results in undefined behavior
> +if the next instruction is a 128-bit wide instruction.
> +
> The BPF program needs to store the return value into register R0 before doing an
> ``EXIT``.
>
> --
> 2.40.1
>
> --
> Bpf mailing list
> Bpf@ietf.org
> https://www.ietf.org/mailman/listinfo/bpf
[-- 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] 5+ messages in thread
* Re: [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst
2024-04-26 23:11 [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst Dave Thaler
2024-04-26 23:11 ` [Bpf] " Dave Thaler
2024-04-28 22:01 ` David Vernet
@ 2024-04-29 10:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-29 10:00 UTC (permalink / raw)
To: Dave Thaler; +Cc: bpf, bpf, dthaler1968
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Fri, 26 Apr 2024 16:11:26 -0700 you wrote:
> This patch elaborates on the use of PC by expanding the PC acronym,
> explaining the units, and the relative position to which the offset
> applies.
>
> v1->v2: reword per feedback from Alexei
>
> v2->v3: reword per feedback from David Vernet
>
> [...]
Here is the summary with links:
- [bpf-next,v3] bpf, docs: Clarify PC use in instruction-set.rst
https://git.kernel.org/bpf/bpf-next/c/07801a24e2f1
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] 5+ messages in thread
end of thread, other threads:[~2024-04-29 10:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-26 23:11 [PATCH bpf-next v3] bpf, docs: Clarify PC use in instruction-set.rst Dave Thaler
2024-04-26 23:11 ` [Bpf] " Dave Thaler
2024-04-28 22:01 ` David Vernet
2024-04-28 22:01 ` David Vernet
2024-04-29 10:00 ` 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;
as well as URLs for NNTP newsgroup(s).