From: Vineet Gupta <vineet.gupta@linux.dev>
To: Eduard Zingerman <eddyz87@gmail.com>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
memxor@gmail.com
Cc: martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev,
jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev,
john.fastabend@gmail.com, shuah@kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [RFC bpf-next 0/6] bpf: track scalar equality across the low 32 bits
Date: Thu, 10 Sep 2026 13:53:52 +0530 [thread overview]
Message-ID: <50286ce9-00cc-484f-9584-9bbe4bf79ef6@linux.dev> (raw)
In-Reply-To: <5f1b726cd88f2261f70a5aa99f94ea1434c078c1.camel@gmail.com>
On 8/19/26 10:05 AM, Eduard Zingerman wrote:
> On Fri, 2026-08-14 at 16:19 -0700, Vineet Gupta wrote:
>> The verifier's linked-scalar machinery tracks register equality only for the
>> full 64 bits (optionally with a constant delta). There is no way to record
>> "these two registers share just their low 32 bits", so a 32-bit mov from a
>> source with unknown high bits has to drop the relationship entirely, and a
>> later narrowing of the source never reaches the destination:
>>
>>> r6 = ... /* full 64-bit unknown */
>>> w7 = w6 /* 32-bit zero-extending mov */
>>> if w6 != 0 goto .Lxx /* not taken: r6's low 32 bits are 0 */
>>> if w7 == 0 goto .Lok <-- not deduced today
>> The same gap exists for the 32-bit sign extension and was the
>> motivation for this patchset.
>>
>>> 0: (61) r2 = *(u32 *)(r1 +24)
>>> 1: (bf) r0 = (s32)r2
>>> 2: (56) if w2 != 0x0 goto pc+10 ; R2=0 (branch taken)
>>> ...
>>> 12: (95) exit
> Note that ldx instructions have similar structure: one can either zero
> or sign extend on 32-bit load. I think this series should be expanded
> to cover these cases.
To scope this, there are two items related to ldx
- Narrowing fill off a wide spilled scalar
- sign extending loads
There's also a case of narrowing spills to handle.
> Also, please drop RFC tag when submitting v2.
Will do, thx.
v2 modulo ldx is ready (and the selftest runs are at par with RFC) but
I'd still like yay/nay on some of the queries before submitting.
Thx,
-Vineet
prev parent reply other threads:[~2026-09-10 8:24 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 23:19 Vineet Gupta
2026-08-14 23:19 ` [RFC bpf-next 1/6] bpf: turn bpf_reg_state->precise into a flags field [NFC] Vineet Gupta
2026-08-18 21:38 ` Eduard Zingerman
2026-08-14 23:19 ` [RFC bpf-next 2/6] bpf: move the linked-scalar flags into bpf_reg_state->flags [NFC] Vineet Gupta
2026-08-18 22:51 ` Eduard Zingerman
2026-09-04 2:54 ` Vineet Gupta
2026-09-04 2:56 ` Vineet Gupta
2026-09-04 2:58 ` Vineet Gupta
2026-09-04 3:29 ` Vineet Gupta
2026-09-04 3:33 ` Mailer snafu (was Re: [RFC bpf-next 2/6] bpf: move the linked-scalar flags into bpf_reg_state->flags [NFC]) Vineet Gupta
2026-08-14 23:19 ` [RFC bpf-next 3/6] bpf: support low-32 subreg scalar linking for zero-extending movs Vineet Gupta
2026-08-19 3:39 ` Eduard Zingerman
2026-09-08 9:48 ` Vineet Gupta
2026-08-19 4:07 ` Eduard Zingerman
2026-09-04 8:44 ` Vineet Gupta
2026-08-14 23:19 ` [RFC bpf-next 4/6] selftests/bpf: cover low-32 subreg-equal link " Vineet Gupta
2026-08-19 5:05 ` Eduard Zingerman
2026-09-03 5:49 ` Vineet Gupta
2026-08-14 23:19 ` [RFC bpf-next 5/6] bpf: support low-32 subreg scalar linking for sign-extending movs Vineet Gupta
2026-08-19 6:18 ` Eduard Zingerman
2026-09-09 12:59 ` Vineet Gupta
2026-08-14 23:19 ` [RFC bpf-next 6/6] selftests/bpf: cover 32-bit sign-extension low-32 links Vineet Gupta
2026-08-19 4:35 ` [RFC bpf-next 0/6] bpf: track scalar equality across the low 32 bits Eduard Zingerman
2026-09-10 8:23 ` Vineet Gupta [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=50286ce9-00cc-484f-9584-9bbe4bf79ef6@linux.dev \
--to=vineet.gupta@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--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
all inboxes | Powered by JetHome®