summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel/kernel-selftest
Commit message (Collapse)AuthorAgeFilesLines
* kernel-selftest: do not run 'make clean'Nora Schiffer2026-06-091-0/+2
| | | | | | | | | | | | | Due to the way the kernel-selftest sources are set up, the toplevel Makefile does not work and `make clean` will always result in a "The source tree is not clean, please run 'make ARCH=... mrproper'" error. Avoid running it by setting CLEANBROKEN = "1", so rebuilding the recipe without a clean (which often happens when the kernel has changed) does not fail. Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: add generic architecture-independent self-testsTelukula Jeevan Kumar Sahu2026-06-071-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add generic kernel self-tests that build cleanly with mainline kernel (6.18+), work on all architectures, and either PASS or SKIP gracefully at runtime. Tests added: - acct: BSD process accounting - breakpoints: hardware breakpoint handling - cachestat: page cache statistics (cachestat syscall) - cgroup: control group v1 interface - clone3: clone3 syscall with flags - core: syscalls like close_range, unshare - coredump: core dump generation - dmabuf-heaps: DMA-BUF heap allocator - efivarfs: EFI variable filesystem - filelock: POSIX file locking (OFD locks) - filesystems: basic filesystem operations - filesystems/binderfs: Android Binder IPC (skips if CONFIG_ANDROID_BINDERFS=n) - filesystems/epoll: epoll syscall extensions - fpu: floating-point unit state - ftrace: function tracer interface - futex: fast userspace mutex - gpio: general purpose I/O - ipc: System V IPC primitives - kcmp: compare kernel resource identifiers - kvm: kernel-based virtual machine - landlock: LSM sandboxing (skips if CONFIG_SECURITY_LANDLOCK=n) - locking: ww_mutex deadlock avoidance - lsm: Linux Security Module interface - membarrier: memory barrier syscalls - mincore: mincore syscall (page residency) - mount: mount syscall (unprivileged variants) - mount_setattr: mount attribute syscall - move_mount_set_group: move_mount peer group - mseal_system_mappings: system mapping sealing - namespaces: PID/UTS/IPC/mount/network namespaces - net: networking stack - net/mptcp: multipath TCP - pidfd: pidfd-based process management - pid_namespace: PID namespace limits - proc: /proc filesystem interface - ptrace: process tracing - rlimits: resource limits - rseq: restartable sequences - sched: scheduler and real-time classes - seccomp: secure computing mode - signal: signal handling - size: ELF size utilities - splice: zero-copy data transfers - sync: cache synchronization - syscall_user_dispatch: user-space syscall dispatch - sysctl: sysctl interface - tc-testing: traffic control - timens: time namespaces - tmpfs: tmpfs filesystem - tpm2: Trusted Platform Module 2.0 - tty: TTY layer - uevent: kernel uevent subsystem - user_events: tracepoint user interface - vDSO: virtual dynamic shared object - watchdog: hardware watchdog timer - zram: compressed RAM block device Tested on aarch64 device BeaglePlay(AM6254 SoC): - Tests either PASS or SKIP gracefully Depends-on: kernel-selftest: add libcap to build and runtime dependencies Signed-off-by: Telukula Jeevan Kumar Sahu <j-sahu@ti.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: add libcap to build and runtime dependenciesTelukula Jeevan Kumar Sahu2026-06-071-2/+2
| | | | | | | | | | | | | | libcap is needed unconditionally for capability-aware tests such as breakpoints, cgroup, clone3, futex, ptrace, and seccomp. Add it to DEPENDS so it is always available at build time and to RDEPENDS so the installed tests can call cap_get_proc() and friends at runtime. bash and libgcc are also added to RDEPENDS: bash is required by several test shell scripts, and libgcc provides libgcc_s.so needed by tests that use GCC-emitted unwinding stubs. Signed-off-by: Telukula Jeevan Kumar Sahu <j-sahu@ti.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: add missing sources if mm is enabledJoao Marcos Costa2026-04-201-0/+1
| | | | | | | | | | | | | | | | | Some headers come from 'mm' (in the top source directory, i.e. the root of Linux's sources), as in the exampels below: Makefile:LOCAL_HDRS += $(selfdir)/mm/local_config.h $(top_srcdir)/mm/gup_test.h cow.c:#include "../../../../mm/gup_test.h" gup_longterm.c:#include "../../../../mm/gup_test.h" gup_test.c:#include <mm/gup_test.h> hmm-tests.c:#include <mm/gup_test.h> uffd-unit-tests.c:#include "../../../../mm/gup_test.h" Add this directory to KERNEL_SELFTEST_SRC if 'mm' PACKAGECONFIG is enabled. Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: fix mm selftests dependenciesJoao Marcos Costa2026-04-202-1/+82
| | | | | | | | | | | | | | | | | Add numa (numactl), as required by rmap, migration, and others. Add liburing, otherwise some tests would be disabled. Moreover, liburing's availability is checked in a shell script executed prior to the compilation of the individual test cases. This script, however, does not read CFLAGS. Backport a fix [1] from mainline to address this issue. [1] https://github.com/torvalds/linux/commit/7f532d19c8be76ad2fcd7ab6b0c9eb618f70966b Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: drop libhugetlbfsJoao Marcos Costa2026-04-201-7/+4
| | | | | | | | | | | | | | | | The support of libhugetlbfs was removed from mainline Linux a while ago, since v6.1 [1]. Since libhugetlbfs was the main reason to remove 'mm' selftests for some specific architectures, the respective operations should only remove bpf. Update the recipe to remove libhugetlbfs as a dependency of mm, and thus unblock this test category for some targets. [1] https://github.com/torvalds/linux/commit/6f83d6c74ea5a5b267be85206822da280cae110a Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: rename vm selftests to mmJoao Marcos Costa2026-04-201-8/+8
| | | | | | | | | | | | | | Since v6.10 [1], this category of selftests was renamed to 'mm'. Update the recipe accordingly. I left a mention to the previous name (i.e., 'vm') just in case. [1]: https://github.com/torvalds/linux/commit/baa489fabd01596d5426d6e112b34ba5fb59ab82 Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
* kernel-selftest: add cpufreq and cpu-hotplug testsTudor Ambarus2025-09-101-0/+2
| | | | | | | | Add cpufreq and cpu-hotplug tests to kernel-selftest. Tested with pixel6. Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: handle missing -64.h headersNylon Chen2025-08-281-1/+10
| | | | | | | | | | Some toolchains ship only bits/*.h without the -64.h suffix, causing the recipe to fail. Add a fallback to use *.h if *-64.h is not found, and warn if neither exists. Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Fix PTP selftest compilation for kernel 6.7+jacobpanov2025-07-091-0/+6
| | | | | | | | | | | | | | | | | The PTP selftest fails to compile with kernel versions 6.7+ due to missing header definitions for PTP_MASK_CLEAR_ALL and PTP_MASK_EN_SINGLE. These definitions were introduced in kernel v6.7 with commit c5a445b. This fix adds kernel headers to CFLAGS during compilation to ensure the required definitions are available. Error before fix: testptp.c:613:31: error: 'PTP_MASK_CLEAR_ALL' undeclared testptp.c:615:38: error: 'PTP_MASK_EN_SINGLE' undeclared Fixes: #878 Signed-off-by: Jacob Panov <jacobpanov@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Remove duplicate setting for SKhem Raj2025-06-281-2/+0
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* meta-openembedded/all: adapt to UNPACKDIR changesAlexander Kanavin2025-06-251-3/+2
| | | | | | | | | | | | | Please see https://git.yoctoproject.org/poky/commit/?id=4dd321f8b83afecd962393101b2a6861275b5265 for what changes are needed, and sed commands that can be used to make them en masse. I've verified that bitbake -c patch world works with these, but did not run a world build; the majority of recipes shouldn't need further fixups, but if there are some that still fall out, they can be fixed in followups. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Convert to use a dedicated UNPACKDIRKhem Raj2025-04-111-5/+4
| | | | | | | | Avoid following warning by using a dedicated unpack directory for sources. WARNING: kernel-selftest-1.0-r0 do_unpack: kernel-selftest: the directory ${WORKDIR}/${BP} (/home/kraj200/yoe/build/tmp/work/qemux86_64-yoe-linux/kernel-self test/1.0/kernel-selftest-1.0) pointed to by the S variable doesn't exist - please set S within the recipe to point to where the source has been unpacked to Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: Fix variable assignment whitespaceRichard Purdie2025-03-201-1/+1
| | | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Update to allow for turning on all testsRyan Eatmon2024-10-111-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | In testing adding in more kernel-selftests there were a number of issues that arose that require changes that are more appropriate for the main recipe and not a bbappend. 1) Stop looping over TEST_LIST ourselves and use the TARGETS="" provided by the kernel-sefltest Makefiles. This correctly sets up various variables that the selftest Makefiles all need. Also, do_install becomes cleaner because the main Makefile already installs the list of tests and the top level script. 2) Add DEBUG_PREFIX_MAP to the CC setting to avoid some "buildpaths" QA errors. 3) Add two INSANE_SKIPS for "already-stripped" and "ldflags". Some of the selftest Makefiles are adding flags to their compiles that basically break the above checks. Since these compiles are not really meant as user level tools and instead testing, it should be ok to just always set INSANE_SKIP for these two. Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Fix build on 32bit arches with 64bit time_tKhem Raj2024-09-172-0/+37
| | | | | | Fix warning where S is expected to exist before do_configure Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: Start WORKDIR -> UNPACKDIR transitionKhem Raj2024-05-231-2/+2
| | | | | | | Replace references of WORKDIR with UNPACKDIR where it makes sense to do so in preparation for changing the default value of UNPACKDIR. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: no longer skip ldflags QAThomas Perrot2024-02-101-2/+2
| | | | | | | Because there is no longer the error. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Add few more testcasesChirag Shilwant2024-01-271-0/+2
| | | | | | | | | This commit will build and install following testcases under /usr/kernel-selftest of filesystem, * ptp * timers Signed-off-by: Chirag Shilwant <c-shilwant@ti.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: remove Wno-alloc-size-larger-than from ↵Khem Raj2024-01-111-0/+1
| | | | | | | | | | scripts/Makefile.extrawarn 6.6+ kernel has the warning options moved to dedicated include file under scripts called Makefile.extrawarn, therefore search for this file as well to remove this unrecognized option by clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Use clang options when clang is availableKhem Raj2023-10-101-8/+8
| | | | | | Enable bpf only with clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Copy the .config from kernel buildKhem Raj2023-10-101-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Build bpf tests againKhem Raj2023-10-092-17/+31
| | | | | | | | | Fix run-ptest script to run all compiled selftests disable bpf on riscv for now Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: Build headers before compiling testsKhem Raj2023-10-021-1/+1
| | | | | | This fixes build failure with kernel 6.5 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* *.patch: add Upstream-Status to all patchesMartin Jansa2023-06-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is new patch-status QA check in oe-core: https://git.openembedded.org/openembedded-core/commit/?id=76a685bfcf927593eac67157762a53259089ea8a This is temporary work around just to hide _many_ warnings from optional patch-status (if you add it to WARN_QA). This just added Upstream-Status: Pending everywhere without actually investigating what's the proper status. This is just to hide current QA warnings and to catch new .patch files being added without Upstream-Status, but the number of Pending patches is now terrible: 5 (26%) meta-xfce 6 (50%) meta-perl 15 (42%) meta-webserver 21 (36%) meta-gnome 25 (57%) meta-filesystems 26 (43%) meta-initramfs 45 (45%) meta-python 47 (55%) meta-multimedia 312 (63%) meta-networking 756 (61%) meta-oe Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* kernel-selftest: install kselftest runnerChase Qi2022-05-071-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>
* 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>