From: Eduard Zingerman <eddyz87@gmail.com>
To: Song Liu <songliubraving@meta.com>
Cc: Song Liu <song@kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
Kernel Team <kernel-team@meta.com>,
"andrii@kernel.org" <andrii@kernel.org>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"martin.lau@linux.dev" <martin.lau@linux.dev>
Subject: Re: [PATCH v2 bpf-next 2/2] selftests/bpf: Add tests for BPF_NEG range tracking logic
Date: Tue, 24 Jun 2025 15:51:17 -0700 [thread overview]
Message-ID: <ff1f998703f75627e1fe939cdc45cf921387c1a7.camel@gmail.com> (raw)
In-Reply-To: <323C8849-FE4F-47A7-ACF1-D30FC066111F@meta.com>
On Tue, 2025-06-24 at 22:49 +0000, Song Liu wrote:
>
> > On Jun 24, 2025, at 3:18 PM, Eduard Zingerman <eddyz87@gmail.com> wrote:
> >
> > On Tue, 2025-06-24 at 15:00 -0700, Song Liu wrote:
> >
> > [...]
> >
> > > +SEC("lsm.s/socket_connect")
> > > +__success __log_level(2)
> > > +__msg("0: (b7) r0 = 1")
> > > +__msg("1: (84) w0 = -w0")
> >
> > Sorry, my previous comment probably was ambiguous.
> > What I meant is that you can match verifier output for "w0 = -w0 ; R0=-1",
> > thus checking that inferred value for "w0".
>
> Ah, I removed that part because I found some other __msg doesn’t have
> the whole line. Let me add it back.
Note: if you need to shorten the matched line you can use regexs
inside __msg strings: __msg("... {{regex-here}} ...")
> Thanks,
> Song
>
> >
> > > +__msg("mark_precise: frame0: last_idx 2 first_idx 0 subseq_idx -1")
> > > +__msg("mark_precise: frame0: regs=r0 stack= before 1: (84) w0 = -w0")
> > > +__msg("mark_precise: frame0: regs=r0 stack= before 0: (b7) r0 = 1")
> > > +__naked int bpf_neg_2(void)
> > > +{
> > > + /*
> > > + * lsm.s/socket_connect requires a return value within [-4095, 0].
> > > + * Returning -1 is allowed
> > > + */
> > > + asm volatile (
> > > + "r0 = 1;"
> > > + "w0 = -w0;"
> > > + "exit;"
> > > + ::: __clobber_all);
> > > +}
> >
> > [...]
prev parent reply other threads:[~2025-06-24 22:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 22:00 [PATCH v2 bpf-next 0/2] Range tracking for BPF_NEG Song Liu
2025-06-24 22:00 ` [PATCH v2 bpf-next 1/2] bpf: Add range " Song Liu
2025-06-24 22:14 ` Eduard Zingerman
2025-06-24 22:43 ` Song Liu
2025-06-24 22:00 ` [PATCH v2 bpf-next 2/2] selftests/bpf: Add tests for BPF_NEG range tracking logic Song Liu
2025-06-24 22:18 ` Eduard Zingerman
2025-06-24 22:49 ` Song Liu
2025-06-24 22:51 ` 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=ff1f998703f75627e1fe939cdc45cf921387c1a7.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@linux.dev \
--cc=song@kernel.org \
--cc=songliubraving@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.