From: Eduard Zingerman <eddyz87@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
bpf@vger.kernel.org, ast@kernel.org
Cc: andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
kernel-team@fb.com, yonghong.song@linux.dev,
shung-hsi.yu@suse.com, paul.chaignon@gmail.com,
harishankar.vishwanathan@gmail.com
Subject: Re: [PATCH bpf-next v2 0/4] bpf: replace min/max fields with struct cnum{32,64}
Date: Fri, 24 Apr 2026 12:01:48 -0700 [thread overview]
Message-ID: <c4fb60bafd526ae2d92b86e2250255aef0ba5ee1.camel@gmail.com> (raw)
In-Reply-To: <DI1GETNIDN91.BJPVEP02OODT@gmail.com>
On Fri, 2026-04-24 at 07:27 -0700, Alexei Starovoitov wrote:
> On Fri Apr 24, 2026 at 1:17 AM PDT, Eduard Zingerman wrote:
> > This RFC replaces s64, u64, s32, u32 scalar range domains tracked by
> > verifier by a pair of circular numbers (cnums): one for 64-bit domain
> > and another for 32-bit domain. Each cnum represents a range as a
> > single arc on the circular number line, from which signed and unsigned
> > bounds are derived on demand. See also wrapped intervals
> > representation as in [1].
> >
> > The use of such representation simplifies arithmetic and conditions
> > handling in verifier.c and allows to express 32 <-> 64 bit deductions
> > in a more mathematically rigorous way.
> >
> > [1] https://jorgenavas.github.io/papers/ACM-TOPLAS-wrapped.pdf
> >
> > Changelog
> > =========
> > RFCv1 -> v2:
> > - Dropped RFC tag.
> > - Dropped cnum{32,64}_mul(), too much complexity and no veristat
> > or selftests gains.
>
> Nice. Less complexity the better.
> I think it's also strong signal that _div(), _mod() versions are not
> needed either.
It might be the case, yes.
The 'union' function from RFCv1 would be needed later,
if we plan to build data flow analyses on top of cnums.
I have v3 with fixes in comments on stand-by.
Hope to hear some thoughts from Shung-Hsi, Paul, Harishankar.
prev parent reply other threads:[~2026-04-24 19:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 8:17 [PATCH bpf-next v2 0/4] bpf: replace min/max fields with struct cnum{32,64} Eduard Zingerman
2026-04-24 8:17 ` [PATCH bpf-next v2 1/4] bpf: representation and basic operations on circular numbers Eduard Zingerman
2026-04-24 9:00 ` bot+bpf-ci
2026-04-24 17:26 ` Eduard Zingerman
2026-04-24 8:17 ` [PATCH bpf-next v2 2/4] bpf: use accessor functions for bpf_reg_state min/max fields Eduard Zingerman
2026-04-24 8:17 ` [PATCH bpf-next v2 3/4] bpf: replace min/max fields with struct cnum{32,64} Eduard Zingerman
2026-04-24 9:12 ` bot+bpf-ci
2026-04-24 17:21 ` Eduard Zingerman
2026-04-24 8:17 ` [PATCH bpf-next v2 4/4] selftests/bpf: new cases handled by 32->64 range refinements Eduard Zingerman
2026-04-24 14:27 ` [PATCH bpf-next v2 0/4] bpf: replace min/max fields with struct cnum{32,64} Alexei Starovoitov
2026-04-24 19:01 ` Eduard Zingerman [this message]
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=c4fb60bafd526ae2d92b86e2250255aef0ba5ee1.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=harishankar.vishwanathan@gmail.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@linux.dev \
--cc=paul.chaignon@gmail.com \
--cc=shung-hsi.yu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox