linux-stable/tools
Jiong Wang 9d120b4127 selftests: bpf: enable hi32 randomization for all tests
The previous libbpf patch allows user to specify "prog_flags" to bpf
program load APIs. To enable high 32-bit randomization for a test, we need
to set BPF_F_TEST_RND_HI32 in "prog_flags".

To enable such randomization for all tests, we need to make sure all places
are passing BPF_F_TEST_RND_HI32. Changing them one by one is not
convenient, also, it would be better if a test could be switched to
"normal" running mode without code change.

Given the program load APIs used across bpf selftests are mostly:
  bpf_prog_load:      load from file
  bpf_load_program:   load from raw insns

A test_stub.c is implemented for bpf seltests, it offers two functions for
testing purpose:

  bpf_prog_test_load
  bpf_test_load_program

The are the same as "bpf_prog_load" and "bpf_load_program", except they
also set BPF_F_TEST_RND_HI32. Given *_xattr functions are the APIs to
customize any "prog_flags", it makes little sense to put these two
functions into libbpf.

Then, the following CFLAGS are passed to compilations for host programs:
  -Dbpf_prog_load=bpf_prog_test_load
  -Dbpf_load_program=bpf_test_load_program

They migrate the used load APIs to the test version, hence enable high
32-bit randomization for these tests without changing source code.

Besides all these, there are several testcases are using
"bpf_prog_load_attr" directly, their call sites are updated to pass
BPF_F_TEST_RND_HI32.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-05-24 18:58:37 -07:00
..
accounting
arch treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
bpf bpftool: update bash-completion w/ new c option for btf dump 2019-05-24 14:05:58 -07:00
build treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
cgroup
crypto crypto: user - rename err_cnt parameter 2018-12-07 14:15:00 +08:00
debugging tools: add a kernel-chktaint to tools/debugging 2019-01-08 16:29:52 -07:00
firewire
firmware tools/firmware/ihex2fw: Replace explicit alignment with ALIGN 2019-01-22 10:23:18 +01:00
gpio tools gpio: Allow overriding CFLAGS 2018-12-28 16:33:08 -03:00
hv Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 2018-11-11 12:58:27 -08:00
iio Merge 5.0-rc6 into staging-next 2019-02-11 09:25:01 +01:00
include tools: bpf: sync uapi header bpf.h 2019-05-24 18:58:37 -07:00
io_uring tools/io_uring: remove IOCQE_FLAG_CACHEHIT 2019-04-08 10:48:50 -06:00
kvm/kvm_stat tools/kvm_stat: switch to python3 2018-11-27 12:53:44 +01:00
laptop
leds
lib libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr 2019-05-24 18:58:37 -07:00
memory-model tools/memory-model: Add support for synchronize_srcu_expedited() 2019-04-04 13:48:34 -07:00
nfsd
objtool treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
pci perf/core improvements and fixes: 2019-05-18 10:24:43 +02:00
pcmcia
perf treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
power treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
scripts
spi treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
testing selftests: bpf: enable hi32 randomization for all tests 2019-05-24 18:58:37 -07:00
thermal/tmon tools thermal tmon: Use -O3 instead of -O1 if available 2019-01-04 12:54:49 -03:00
time
usb treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
virtio treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
vm tools/vm/slabinfo: clean up usage menu debug items 2019-03-05 21:07:20 -08:00
wmi treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile Merge branch 'thorsten' into docs-next 2019-01-08 16:38:36 -07:00