linux/tools/testing/selftests
Alexei Starovoitov 03d4d13fab selftests/bpf: Add profiler test
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
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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20201009011240.48506-4-alexei.starovoitov@gmail.com
2020-10-09 22:03:06 +02:00
..
android SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
arm64 kselftest: arm64: Remove redundant clean target 2020-06-24 14:25:59 +01:00
bpf selftests/bpf: Add profiler test 2020-10-09 22:03:06 +02:00
breakpoints selftests: breakpoints: do not use ksft_exit_skip after ksft_set_plan 2020-07-06 15:47:48 -06:00
capabilities .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
cgroup kselftests: cgroup: add perpcu memory accounting test 2020-08-12 10:57:55 -07:00
clone3 linux-kselftest-5.9-rc1 2020-08-05 10:28:25 -07:00
core tests: add CLOSE_RANGE_UNSHARE tests 2020-06-17 00:07:38 +02:00
cpu-hotplug
cpufreq
dmabuf-heaps kselftests: dmabuf-heaps: Fix confused return value on expected error testing 2020-05-08 09:40:58 -06:00
drivers selftests: mlxsw: Add a PFC test 2020-09-30 14:06:54 -07:00
efivarfs .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
exec selftests/exec: add file type errno tests 2020-08-14 19:56:56 -07:00
filesystems selftests/binderfs: Fix harness API usage 2020-07-06 15:59:16 -06:00
firmware selftest/firmware: Add selftest timeout in settings 2020-07-25 12:05:20 +02:00
fpu selftests/fpu: Add an FPU selftest 2020-06-29 10:02:23 +02:00
ftrace selftests/ftrace: Support ":README" suffix for requires 2020-06-16 10:42:47 -06:00
futex .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
gpio selftests: add build/cross-build dependency check script 2020-04-23 17:23:20 -06:00
ia64 .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
intel_pstate selftests: add build/cross-build dependency check script 2020-04-23 17:23:20 -06:00
ipc selftests/ipc: Fix test failure seen after initial test run 2020-04-14 10:24:28 -06:00
ir .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kcmp .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kexec
kmod selftests: kmod: use variable NAME in kmod_test_0001() 2020-08-12 10:58:01 -07:00
kselftest Driver core changes for 5.9-rc1 2020-08-05 11:52:17 -07:00
kvm selftests: kvm: Use a shorter encoding to clear RAX 2020-08-17 13:45:22 -04:00
lib lib: make a test module with set/clear bit 2020-06-04 19:06:25 -07:00
livepatch selftests/livepatch: adopt to newer sysctl error format 2020-07-15 08:54:35 +02:00
lkdtm lkdtm: Make arch-specific tests always available 2020-06-29 18:41:39 +02:00
locking
media_tests .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
membarrier .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
memfd selftests: add build/cross-build dependency check script 2020-04-23 17:23:20 -06:00
memory-hotplug
mincore selftests: add mincore() tests 2020-08-07 11:33:27 -07:00
mount .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
mqueue .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
net selftests: net: Add drop monitor test 2020-09-30 18:01:26 -07:00
netfilter selftests: netfilter: add command usage 2020-08-28 20:12:00 +02:00
nsfs tools/testing: Replace zero-length array with flexible-array 2020-05-08 09:42:14 -06:00
ntb NTB: ntb_test: Fix bug when counting remote files 2020-06-05 20:02:09 -04:00
openat2 .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
pid_namespace selftests: Remove unneeded selftest API headers 2020-07-06 15:59:07 -06:00
pidfd linux-kselftest-5.9-rc1 2020-08-05 10:28:25 -07:00
powerpc selftests/powerpc: Skip PROT_SAO test in guests/LPARS 2020-09-01 22:47:02 +10:00
prctl .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
proc proc: use human-readable values for hidepid 2020-04-22 10:51:22 -05:00
pstore pstore/platform: Use backend name for console registration 2020-05-30 10:34:02 -07:00
ptp testptp: add new options for perout phase and pulse width 2020-07-20 18:04:59 -07:00
ptrace SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
rcutorture Merge branches 'doc.2020.06.29a', 'fixes.2020.06.29a', 'kfree_rcu.2020.06.29a', 'rcu-tasks.2020.06.29a', 'scale.2020.06.29a', 'srcu.2020.06.29a' and 'torture.2020.06.29a' into HEAD 2020-06-29 12:03:15 -07:00
resctrl selftests/resctrl: fix spelling mistake "Errror" -> "Error" 2020-03-13 13:29:22 -06:00
rseq .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
rtc .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
safesetid .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
seccomp Cleanup, SECCOMP_FILTER support, message printing fixes, and other 2020-08-15 18:50:32 -07:00
sigaltstack selftests: sigaltstack: do not use ksft_exit_skip after ksft_set_plan 2020-07-06 15:57:15 -06:00
size .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
sparc64 .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
splice selftests: splice: Check behavior of full and short splices 2020-08-07 10:50:11 -07:00
static_keys
sync selftests: sync_test: do not use ksft_exit_skip after ksft_set_plan 2020-07-06 15:57:28 -06:00
sysctl linux-kselftest-5.8-rc1 2020-06-09 10:03:12 -07:00
tc-testing tc-testing: Add tdc to kselftests 2020-07-20 18:29:37 -07:00
timens selftests/timens: handle a case when alarm clocks are not supported 2020-05-22 13:29:55 -06:00
timers selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
tmpfs .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
tpm2 selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3 2020-07-06 14:20:35 -06:00
uevent selftests: Remove unneeded selftest API headers 2020-07-06 15:59:07 -06:00
user
vDSO selftests: vdso: Add a selftest for vDSO getcpu() 2020-05-22 11:05:07 -06:00
vm selftests/vm: fix display of page size in map_hugetlb 2020-09-19 13:13:39 -07:00
watchdog .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
wireguard wireguard: device: avoid circular netns references 2020-06-23 14:50:34 -07:00
x86 Merge branch 'gate-page-refcount' (patches from Dave Hansen) 2020-09-03 18:43:06 -07:00
zram
.gitignore SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
gen_kselftest_tar.sh selftests: introduce gen_tar Makefile target 2020-05-19 16:11:46 -06:00
kselftest_deps.sh selftests: add build/cross-build dependency check script 2020-04-23 17:23:20 -06:00
kselftest_harness.h selftests/harness: Limit step counter reporting 2020-07-17 13:56:35 -06:00
kselftest_install.sh selftests: gen_kselftest_tar.sh: Do not clobber kselftest/ 2019-11-07 14:43:27 -07:00
kselftest_module.h
kselftest.h linux-kselftest-5.9-rc1 2020-08-05 10:28:25 -07:00
lib.mk selftests: fix condition in run_tests 2020-07-07 14:11:31 -06:00
Makefile selftests: add mincore() tests 2020-08-07 11:33:27 -07:00