summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel/kernel-selftest
Commit message (Collapse)AuthorAgeFilesLines
* kernel-selftest: install kselftest runnerChase Qi2022-11-011-1/+7
| | | | | | | | | Install kselftest runner and the required kselftest-list.txt. Signed-off-by: Chase Qi <chase.qi@linaro.org> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit fd330c4514ae5acefa5e472e6775419066d60385) Signed-off-by: Armin Kuster <akuster808@gmail.com>
* recipes: Update LICENSE variable to use SPDX license identifiersKhem Raj2022-03-041-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Convert to new override syntaxMartin Jansa2021-08-031-10/+10
| | | | | | | | | | This is the result of automated script (0.9.1) conversion: oe-core/scripts/contrib/convert-overrides.py . converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* libhugetlbfs: Disable build with glibc 2.34+Khem Raj2021-08-031-2/+1
| | | | | | | | | | It uses __morecore internal function from glibc which has been removed in 2.34+ and replacing it is not so simple and upstream needs to fix it see [1] [1] https://github.com/libhugetlbfs/libhugetlbfs/issues/52 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Disable building bpfKhem Raj2021-02-081-1/+1
| | | | | | | | with 5.10 it builds bpf-bootstrap tool and then tries to run it as well which wont work in cross builds. Disable it until it can be make cross compile friendly. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Disable vm packageconfig for riscvKhem Raj2020-11-041-0/+4
| | | | | | it now needs libhugetlbfs which is not ported to riscv yet Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Disable vm tests for mips/armKhem Raj2020-08-241-4/+8
| | | | | | | | | | | Include lib and kernel subdirs as vm tests need headers from it in 5.8+ (test_hmm_uapi.h) see [1] It now uses tests which are not compatible on arm starting with 5.8+ [1] https://lkml.org/lkml/2020/4/22/1654 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Tests in 5.8 depend on libhugetlbfs.hKhem Raj2020-08-211-1/+1
| | | | | | | | | Fixes | hmm-tests.c:24:10: fatal error: hugetlbfs.h: No such file or directory | 24 | #include <hugetlbfs.h> | | ^~~~~~~~~~~~~ Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Specify the target with -target instead of -archKhem Raj2020-04-131-1/+1
| | | | | | This ensures that generated code is properly cross compiled Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: only emit warning on clang if bpf is builtScott Branden2020-03-311-0/+3
| | | | | | | Only emit warning on clang if bpf is actually in PACKAGECONFIG. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: add firmware testsScott Branden2020-03-311-2/+3
| | | | | | | Add firmware tests to kernel-selftest. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Disable bpf tests on mipsKhem Raj2020-02-021-1/+5
| | | | | | | | | | | | | | | | | | | 5.4 kernel exposes a problem, where its using host includes to compile BPF tests and it fails for mips because ptrace.h is quite different so it can not find the needed pt_struct definitions during cross compile % clang -fno-stack-protector -I. -I./include/uapi -I../../../include/uapi -I/mnt/b/yoe/build/tmp/work/qemumips-yoe-linux/kernel-selft est/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/../usr/include -D__TARGET_ARCH_mips -g -idirafter /mnt/b/yoe/build/tmp/wor k/qemumips-yoe-linux/kernel-selftest/1.0-r0/recipe-sysroot-native/usr/lib/clang/10.0.0/include -Wno-compare-distinct-pointer-types -O2 -target bpf -emit-llvm \ -c progs/loop1.c progs/loop1.c:21:9: error: no member named 'regs' in 'struct pt_regs' m = PT_REGS_RC(ctx); ^~~~~~~~~~~~~~~ ./bpf_helpers.h:466:29: note: expanded from macro 'PT_REGS_RC' ~~ ^ 1 error generated. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Include rtc testsAndrei Gherzan2020-01-061-0/+1
| | | | | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Exclude from world buildsKhem Raj2019-09-181-0/+4
| | | | | | Avoid need for installing clang on host, or depending on meta-clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Needs error.h which is missing in muslKhem Raj2019-09-091-0/+2
| | | | | | | | prog_tests/flow_dissector.c:3:10: fatal error: error.h: No such file or directory | #include <error.h> | ^~~~~~~~~ Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Explicitly disable stack protectorKhem Raj2019-08-291-20/+2
| | | | | | | | | | selftests do not support it and clang from meta-clang builds with this turned on by default Disable security flags completely, drop all workarounds used to get around the hoop Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Warn conditionally about clang-native dependencyKhem Raj2019-08-291-3/+4
| | | | | | | When meta-clang is in mix then it does the right thing already so no need to warn in that case Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: skip -Werror=format-security and fortifyMartin Jansa2019-08-121-0/+11
| | | | | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: temporary disable bpf for arm - fix build for qemuarmAndrea Adami2018-10-271-0/+1
| | | | | | | | | | | | | | | Even running on 32bit the bpf objects are 64bit: this triggers the QA about bitsize mismatch 32 vs. 64. Besides, objdump does not recognize the arch 0xf7. Trying the workaround to use the llvm-objdump and setting TOOLCHAIN = "clang" the build for arm fails on libcxx |include/c++/8.2.0/atomic:250: undefined reference to `__atomic_load_4' Temporary disable bpf as done for x86/32bit as it seems still unstable. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Remove bpf on x86/32bitKhem Raj2018-09-261-0/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Newer kernels 4.18+ need llc from llvmKhem Raj2018-09-241-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Fix build on muslKhem Raj2018-09-143-54/+5
| | | | | | | | | | | * (Depends upon a linux-libc-headers patch proposed to oe-core) * Delete unused patch * Mark Clang 6.0 as minimum required version * Do not hardcode python3 interpreter path Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Hongzhi.Song <hongzhi.song@windriver.com> Cc: Martin Jansa <Martin.Jansa@gmail.com>
* kernel-selftest: Fix the COPYING checksum variablityKhem Raj2018-08-282-358/+26
| | | | | | | | | | | | COPYING coming from kernel sources but the md5 is static value saved in recipe does not scale to all kind of machines which may have different kernel providers filling in, therefore keep a static copy of COPYING file as well, additionally copy LICENSES directory ( if it exists) into sources where all the real license texts are living Document need for clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: add dependency on libcapMartin Jansa2018-08-191-1/+1
| | | | | | | | | | | | * vm selftest uses it as well: i586-webos-linux-gcc -m32 -march=i586 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security --sysroot=kernel-selftest/1.0-r0/recipe-sysroot -Wall -I ../../../../usr/include -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now mlock-random-test.c -lrt -lcap -o kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/vm/mlock-random-test mlock-random-test.c:8:10: fatal error: sys/capability.h: No such file or directory #include <sys/capability.h> ^~~~~~~~~~~~~~~~~~ compilation terminated. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: add ptest supportDengke Du2018-08-192-1/+14
| | | | | | | Group the kernel-selftest testcases in run-ptest. Signed-off-by: Dengke Du <dengke.du@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: fix various issuesMartin Jansa2018-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * respect PACKAGECONFIG when setting TEST_LIST * call the sed in remove_clang_related only when bpf PACKAGECONFIG is enabled and if ${S}/tools/testing/selftests/bpf/Makefile doesn't exist then show more useful error message than: sed: can't read kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/Makefile: No such file or directory because kernels older than 4.10 don't have bpf selftest which was added in: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d * disable ldflags QA errors, the selftests Makefile explicitly overrides LDFLAGS to empty: https://github.com/torvalds/linux/blob/5aa5bd14c5f8660c64ceedf14a549781be47e53d/tools/testing/selftests/Makefile#L46 and the vm/Makefile doesn't respect LDFLAGS anyway: https://github.com/torvalds/linux/blob/5aa5bd14c5f8660c64ceedf14a549781be47e53d/tools/testing/selftests/vm/Makefile#L17 so it was causing a lot of errors: ERROR: kernel-selftest-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/thuge-gen' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/thuge-gen' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/transhuge-stress' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/transhuge-stress' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/userfaultfd' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/userfaultfd' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-shm' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-shm' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/on-fault-limit' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/on-fault-limit' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-mmap' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-mmap' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/compaction_test' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/compaction_test' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/mlock2-tests' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/mlock2-tests' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/map_hugetlb' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/map_hugetlb' [ldflags] * fix the formatting and useless append * add dependency on rsync-native as it's used during do_install: | make: Entering directory 'kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/vm' | rsync -a run_vmtests compaction_test hugepage-mmap hugepage-shm map_hugetlb mlock2-tests on-fault-limit thuge-gen transhuge-stress userfaultfd kernel-selftest/1.0-r0/image/usr/kernel-selftest/vm/ | /bin/sh: 1: rsync: not found | ../lib.mk:24: recipe for target 'install' failed Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: compatible with latest kernelHongzhi.Song2018-08-191-3/+3
| | | | | | | | There are some new program added for bpf. So we make corresponding modifications. Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: fix various issuesMartin Jansa2018-08-161-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * respect PACKAGECONFIG when setting TEST_LIST * call the sed in remove_clang_related only when bpf PACKAGECONFIG is enabled and if ${S}/tools/testing/selftests/bpf/Makefile doesn't exist then show more useful error message than: sed: can't read kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/Makefile: No such file or directory because kernels older than 4.10 don't have bpf selftest which was added in: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d * disable ldflags QA errors, the selftests Makefile explicitly overrides LDFLAGS to empty: https://github.com/torvalds/linux/blob/5aa5bd14c5f8660c64ceedf14a549781be47e53d/tools/testing/selftests/Makefile#L46 and the vm/Makefile doesn't respect LDFLAGS anyway: https://github.com/torvalds/linux/blob/5aa5bd14c5f8660c64ceedf14a549781be47e53d/tools/testing/selftests/vm/Makefile#L17 so it was causing a lot of errors: ERROR: kernel-selftest-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/thuge-gen' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/thuge-gen' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/transhuge-stress' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/transhuge-stress' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/userfaultfd' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/userfaultfd' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-shm' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-shm' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/on-fault-limit' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/on-fault-limit' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-mmap' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-mmap' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/compaction_test' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/compaction_test' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/mlock2-tests' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/mlock2-tests' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/map_hugetlb' No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/map_hugetlb' [ldflags] * fix the formatting and useless append * add dependency on rsync-native as it's used during do_install: | make: Entering directory 'kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/vm' | rsync -a run_vmtests compaction_test hugepage-mmap hugepage-shm map_hugetlb mlock2-tests on-fault-limit thuge-gen transhuge-stress userfaultfd kernel-selftest/1.0-r0/image/usr/kernel-selftest/vm/ | /bin/sh: 1: rsync: not found | ../lib.mk:24: recipe for target 'install' failed Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
* kernel-selftest: Add a recipe on kernel selftestHongzhi.Song2018-08-025-0/+833
The recipe builds the framework for kernel-selftest. Now, it just contains two sets of testcase, bpf and vm. We will append more to this recipe. The following kernel config fragments must be manually enabled, i.e. in local.conf, to use this test suite. KERNEL_FEATURES_append += "features/bpf/bpf.scc \ cfg/debug-kselftest.scc \ features/hugetlb/hugetlb.scc \ " Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>