Allow to specify mode in KCOV_IOC_ENABLE synchronizing the functionality
with Linux, FreeBSD and OpenBSD. As a NetBSD (and OpenBSD) specific of
the ioctl(2) interface, the mode argument has to be specified as &value
rather than value.
There are 3 modes available:
1. KCOV_MODE_NONE -- no trace specified, useful for testing purposes
2. KCOV_MODE_TRACE_PC -- trace the kernel program counter
3. KCOV_MODE_TRACE_CMP -- trace comparison instructions and switch statements
Adapt the ATF tests and documentation for new API.
The KCOV_MODE_TRACE_CMP mode is implemented but still awaits for the
GCC 8.x upgrade or selection of Clang/LLVM as the kernel compiler.
Obtained from OpenBSD and adapted for NetBSD by myself.
Reuse the fd_clone() API to associate kcov descriptors (KD) with a file
descriptor. Each fd (/dev/kcov) can be reused for a single LWP.
Add new ATF regression tests and cleanup existing code there. All tests
pass.
Refresh the kcov(4) man page documentation.
Developed with help from <maxv>.
- add ${X11SRCDIR.MesaLib.old} and introduce ${X11SRCDIR.Mesa} as an
alias for either the former or the non old. this allows many of
the makefiles to simply use ${X11SRCDIR.Mesa} (but does not really
enable much sharing of makefiles, but reduces their diffs.)
- use mesa-which.mk to define ${OLD_PREFIX} to either "" or ".old",
and to know if to build 'dri7' (.old only.) ${OLD_PREFIX} is used
by other code (eg, LIBDPLIBS) to pick the right subdir.
Previously spi would configure the controller to use the lowest speed of
all connected devices since the kernel started and to fail attempted mode
changes. This is now improved to keep individual modes and speeds for each
slave and to reconfigure the controller as necessary for each transfer.
Added man page for spi(9).
The KCOV driver implements collection of code coverage inside the kernel.
It can be enabled on a per process basis from userland, allowing the kernel
program counter to be collected during syscalls triggered by the same
process.
The device is oriented towards kernel fuzzers, in particular syzkaller.
Currently the only supported coverage type is -fsanitize-coverage=trace-pc.
The KCOV driver was initially developed in Linux. A driver based on the
same concept was then implemented in FreeBSD and OpenBSD.
Documentation is borrowed from OpenBSD and ATF tests from FreeBSD.
This patch has been prepared by Siddharth Muralee, improved by <maxv>
and polished by myself before importing into the mainline tree.
All ATF tests pass.