From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: davem@davemloft.net
Cc: daniel@iogearbox.net, john.fastabend@gmail.com,
netdev@vger.kernel.org, bpf@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH v2 bpf-next 0/4] bpf: Make the verifier recognize llvm register allocation patterns.
Date: Thu, 8 Oct 2020 18:12:36 -0700 [thread overview]
Message-ID: <20201009011240.48506-1-alexei.starovoitov@gmail.com> (raw)
From: Alexei Starovoitov <ast@kernel.org>
v1->v2:
- fixed 32-bit mov issue spotted by John.
- allowed r2=r1; r3=r2; sequence as suggested by John.
- added comments, acks, more tests.
Make two verifier improvements:
- The llvm register allocator may use two different registers representing the
same virtual register. Teach the verifier to recognize that.
- Track bounded scalar spill/fill.
The profiler[123] test in patch 3 will fail to load without patches 1 and 2.
The profiler[23] test may fail to load on older llvm due to speculative
code motion nd instruction combining optimizations that are fixed in
https://reviews.llvm.org/D85570
Alexei Starovoitov (3):
bpf: Propagate scalar ranges through register assignments.
selftests/bpf: Add profiler test
selftests/bpf: Asm tests for the verifier regalloc tracking.
Yonghong Song (1):
bpf: Track spill/fill of bounded scalars.
kernel/bpf/verifier.c | 66 +-
tools/testing/selftests/bpf/README.rst | 38 +
.../testing/selftests/bpf/prog_tests/align.c | 16 +-
.../selftests/bpf/prog_tests/test_profiler.c | 72 ++
tools/testing/selftests/bpf/progs/profiler.h | 177 ++++
.../selftests/bpf/progs/profiler.inc.h | 969 ++++++++++++++++++
tools/testing/selftests/bpf/progs/profiler1.c | 6 +
tools/testing/selftests/bpf/progs/profiler2.c | 6 +
tools/testing/selftests/bpf/progs/profiler3.c | 6 +
.../bpf/verifier/direct_packet_access.c | 2 +-
.../testing/selftests/bpf/verifier/regalloc.c | 243 +++++
11 files changed, 1591 insertions(+), 10 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/test_profiler.c
create mode 100644 tools/testing/selftests/bpf/progs/profiler.h
create mode 100644 tools/testing/selftests/bpf/progs/profiler.inc.h
create mode 100644 tools/testing/selftests/bpf/progs/profiler1.c
create mode 100644 tools/testing/selftests/bpf/progs/profiler2.c
create mode 100644 tools/testing/selftests/bpf/progs/profiler3.c
create mode 100644 tools/testing/selftests/bpf/verifier/regalloc.c
--
2.23.0
next reply other threads:[~2020-10-09 1:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 1:12 Alexei Starovoitov [this message]
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
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=20201009011240.48506-1-alexei.starovoitov@gmail.com \
--to=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