aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/arm64/mp_machdep.c
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2019-11-21 11:22:08 +0000
committerAndrew Turner <andrew@FreeBSD.org>2019-11-21 11:22:08 +0000
commit849aef496d2ae19961310f4e92f3a0b928732d26 (patch)
treec9872d59d6c400ed994da160ee8d67aada890e55 /sys/arm64/arm64/mp_machdep.c
parent489912da7bb487a33a7f0642a983c233b22381ba (diff)
downloadsrc-849aef496d2ae19961310f4e92f3a0b928732d26.tar.gz
src-849aef496d2ae19961310f4e92f3a0b928732d26.zip
Port the NetBSD KCSAN runtime to FreeBSD.
Update the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime to work in the FreeBSD kernel. It is a useful tool for finding data races between threads executing on different CPUs. This can be enabled by enabling KCSAN in the kernel config, or by using the GENERIC-KCSAN amd64 kernel. It works on amd64 and arm64, however the later needs a compiler change to allow -fsanitize=thread that KCSAN uses. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22315
Notes
Notes: svn path=/head/; revision=354942
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
-rw-r--r--sys/arm64/arm64/mp_machdep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index 2efdce76c891..bbda274bb226 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/cpu.h>
+#include <sys/csan.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/malloc.h>
@@ -253,6 +254,8 @@ init_secondary(uint64_t cpu)
mtx_unlock_spin(&ap_boot_mtx);
+ kcsan_cpu_init(cpu);
+
/* Enter the scheduler */
sched_throw(NULL);