public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Hao Sun <sunhao.th@gmail.com>,
	 Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Bug Report] bpf: incorrectly pruning runtime execution path
Date: Fri, 15 Dec 2023 04:28:20 +0200	[thread overview]
Message-ID: <66b2a6c45045c207d8452ad3b5786a9dc0082d79.camel@gmail.com> (raw)
In-Reply-To: <CAADnVQ+RVT1pO1hTzMawdkfc9B0xAxas2XmSk6+_EiqX9Xy9Ug@mail.gmail.com>

On Thu, 2023-12-14 at 18:16 -0800, Alexei Starovoitov wrote:
[...]
> > E.g. for the test-case at hand:
> > 
> >   0: (85) call bpf_get_prandom_u32#7    ; R0=scalar()
> >   1: (bf) r7 = r0                       ; R0=scalar(id=1) R7_w=scalar(id=1)
> >   2: (bf) r8 = r0                       ; R0=scalar(id=1) R8_w=scalar(id=1)
> >   3: (85) call bpf_get_prandom_u32#7    ; R0=scalar()
> >   --- checkpoint #1 r7.id = 1, r8.id = 1 ---
> >   4: (25) if r0 > 0x1 goto pc+0         ; R0=scalar(smin=smin32=0,smax=umax=smax32=umax32=1,...)
> >   --- checkpoint #2 r7.id = 1, r8.id = 1 ---
> >   5: (3d) if r8 >= r0 goto pc+3         ; R0=1 R8=0 | record r8.id=1 in jump history
> >   6: (0f) r8 += r8                      ; R8=0
> 
> can we detect that any register link is broken and force checkpoint here?

Should be possible. I'll try this in the morning and check veristat results.

By the way, I added some stats collection for find_equal_scalars() and see
the following results when run on ./test_progs:
- maximal number of registers with same id per call: 3
- average number of registers with same id per call: 1.4

  reply	other threads:[~2023-12-15  2:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 15:31 [Bug Report] bpf: incorrectly pruning runtime execution path Hao Sun
2023-12-13  0:51 ` Andrii Nakryiko
2023-12-13 10:25   ` Hao Sun
2023-12-13 23:30     ` Andrii Nakryiko
2023-12-14  0:08       ` Eduard Zingerman
2023-12-14  0:36         ` Andrii Nakryiko
2023-12-13 23:35     ` Eduard Zingerman
2023-12-13 23:40       ` Andrii Nakryiko
2023-12-13 23:47         ` Eduard Zingerman
2023-12-13 23:50           ` Andrii Nakryiko
2023-12-14  9:38       ` Hao Sun
2023-12-14 15:10         ` Eduard Zingerman
2023-12-14 16:26           ` Eduard Zingerman
2023-12-15  0:06             ` Andrii Nakryiko
2023-12-15  0:16               ` Eduard Zingerman
2023-12-15  0:49               ` Eduard Zingerman
2023-12-15  1:24                 ` Eduard Zingerman
2023-12-15  1:43                   ` Eduard Zingerman
2023-12-15  2:16                   ` Alexei Starovoitov
2023-12-15  2:28                     ` Eduard Zingerman [this message]
2023-12-15  5:20                       ` Andrii Nakryiko
2023-12-15 16:22                         ` Eduard Zingerman
2023-12-15 17:01                           ` Andrii Nakryiko
2023-12-15 20:55                     ` Eduard Zingerman

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=66b2a6c45045c207d8452ad3b5786a9dc0082d79.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sunhao.th@gmail.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