kcov: initial implementation

Implement a device (/dev/kcov) that exposes coverage info for the
kernel. This will be especially useful for coverage-based fuzzing (e.g.
syzkaller).

Exclude a lot of functions which would crash/otherwise interfere in the
coverage, including only processing coverage callbacks when not handling
an irq.
This commit is contained in:
Matheus
2026-10-06 11:05:58 -03:00
parent 111a8696d8
commit e4a4896b4b
14 changed files with 581 additions and 25 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ DEFINE_KERNEL_ARGUMENT(rootfs, char *);
DEFINE_KERNEL_ARGUMENT(initrd, bool);
DEFINE_KERNEL_ARGUMENT(root_wait, bool);
void kernel_entry() {
KCOV_DISABLED void kernel_entry() {
cpu_set(&bsp_cpu);
#ifdef TERM_EARLY_INIT