From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: dthaler1968@googlemail.com
Cc: bpf@vger.kernel.org, Dave Thaler <dthaler@microsoft.com>
Subject: Re: [PATCH] bpf, docs: Fix modulo zero, division by zero, overflow, and underflow
Date: Wed, 18 Jan 2023 10:43:31 +0100 [thread overview]
Message-ID: <87o7qw18l8.fsf@oracle.com> (raw)
In-Reply-To: <20230117224951.984-1-dthaler1968@googlemail.com> (dthaler's message of "Tue, 17 Jan 2023 22:49:51 +0000")
> +Also note that the division and modulo operations are unsigned.
> +Thus, for `BPF_ALU`, 'imm' is first converted to an unsigned
> +32-bit value, whereas for `BPF_ALU64`, 'imm' is first sign extended
> +to 64 bits and then converted to an unsigned 64-bit value. There
> +are no instructions for signed division or modulo.
English is not my native language, but I think "converted" may be too
generic for this paragraph: are the same bits reinterpreted as unsigned?
Or an actual conversion like absolute value is performed?
Wouldn't it be better to say "interpreted as" instead of "converted to"
in this case?
Something like this:
"Also note that the division and modulo operations are unsigned.
Thus, for `BPF_ALU`, 'imm' is interpreted as an unsigned 32-bit
value, whereas for `BPF_ALU64`, 'imm' is first sign extended to 64
bits and the result interpreted as an unsigned 64-bit value. There
are no instructions for signed division or modulo."
next prev parent reply other threads:[~2023-01-18 10:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 22:49 [PATCH] bpf, docs: Fix modulo zero, division by zero, overflow, and underflow dthaler1968
2023-01-18 9:43 ` Jose E. Marchesi [this message]
2023-01-18 15:23 ` dthaler1968
2023-01-18 16:20 ` Daniel Borkmann
2023-01-19 22:04 ` dthaler1968
2023-01-20 1:01 ` Alexei Starovoitov
2023-01-20 20:16 ` dthaler1968
2023-01-23 21:45 ` Daniel Borkmann
2023-01-24 0:12 ` dthaler1968
2023-01-24 15:50 ` patchwork-bot+netdevbpf
-- strict thread matches above, loose matches on Subject: below --
2023-01-05 16:32 dthaler1968
2023-01-05 19:01 ` sdf
2023-01-06 16:27 ` Daniel Borkmann
2023-01-06 18:11 ` Dave Thaler
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=87o7qw18l8.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=bpf@vger.kernel.org \
--cc=dthaler1968@googlemail.com \
--cc=dthaler@microsoft.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