From: Yonghong Song <yhs@fb.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>, <davem@davemloft.net>
Cc: <daniel@iogearbox.net>, <john.fastabend@gmail.com>,
<netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
<kernel-team@fb.com>
Subject: Re: [PATCH v2 bpf-next 3/4] selftests/bpf: Add profiler test
Date: Thu, 8 Oct 2020 23:49:27 -0700 [thread overview]
Message-ID: <5c129fe9-85ad-b914-67d3-435ca7eb2d47@fb.com> (raw)
In-Reply-To: <20201009011240.48506-4-alexei.starovoitov@gmail.com>
On 10/8/20 6:12 PM, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
>
> The main purpose of the profiler test to check different llvm generation
> patterns to make sure the verifier can load these large programs.
>
> Note that profiler.inc.h test doesn't follow strict kernel coding style.
> The code was formatted in the kernel style, but variable declarations are
> kept as-is to preserve original llvm IR pattern.
>
> profiler1.c should pass with older and newer llvm
>
> profiler[23].c may fail on older llvm that don't have:
> https://reviews.llvm.org/D85570
Not sure but the below equivalent URL may be more intuitive:
https://reviews.llvm.org/D85570
> because llvm may do speculative code motion optimization that
> will generate code like this:
>
> // r9 is a pointer to map_value
> // r7 is a scalar
> 17: bf 96 00 00 00 00 00 00 r6 = r9
> 18: 0f 76 00 00 00 00 00 00 r6 += r7
> 19: a5 07 01 00 01 01 00 00 if r7 < 257 goto +1
> 20: bf 96 00 00 00 00 00 00 r6 = r9
> // r6 is used here
>
> The verifier will reject such code with the error:
> "math between map_value pointer and register with unbounded min value is not allowed"
> At insn 18 the r7 is indeed unbounded. The later insn 19 checks the bounds and
> the insn 20 undoes map_value addition. It is currently impossible for the
> verifier to understand such speculative pointer arithmetic. Hence llvm D85570
> addresses it on the compiler side.
>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
next prev parent reply other threads:[~2020-10-09 6:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 1:12 [PATCH v2 bpf-next 0/4] bpf: Make the verifier recognize llvm register allocation patterns Alexei Starovoitov
2020-10-09 1:12 ` [PATCH v2 bpf-next 1/4] bpf: Propagate scalar ranges through register assignments Alexei Starovoitov
2020-10-09 19:42 ` John Fastabend
2020-10-09 1:12 ` [PATCH v2 bpf-next 2/4] bpf: Track spill/fill of bounded scalars Alexei Starovoitov
2020-10-09 19:49 ` John Fastabend
2020-10-09 1:12 ` [PATCH v2 bpf-next 3/4] selftests/bpf: Add profiler test Alexei Starovoitov
2020-10-09 6:49 ` Yonghong Song [this message]
2020-10-09 15:08 ` Alexei Starovoitov
2020-10-09 15:13 ` Yonghong Song
2020-10-13 19:56 ` Jiri Olsa
2020-10-13 21:03 ` Alexei Starovoitov
2020-10-13 21:56 ` Andrii Nakryiko
2020-10-15 6:09 ` Song Liu
2020-11-04 16:45 ` Jiri Olsa
2020-11-04 20:50 ` Andrii Nakryiko
2020-11-04 21:57 ` Jiri Olsa
2020-10-13 21:59 ` Jiri Olsa
2020-10-14 0:21 ` Song Liu
2020-10-09 1:12 ` [PATCH v2 bpf-next 4/4] selftests/bpf: Asm tests for the verifier regalloc tracking Alexei Starovoitov
2020-10-09 20:06 ` John Fastabend
2020-10-09 20:10 ` [PATCH v2 bpf-next 0/4] bpf: Make the verifier recognize llvm register allocation patterns patchwork-bot+netdevbpf
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=5c129fe9-85ad-b914-67d3-435ca7eb2d47@fb.com \
--to=yhs@fb.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).