diff options
Diffstat (limited to 'sys/arm64/arm64/machdep.c')
-rw-r--r-- | sys/arm64/arm64/machdep.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 31e7568a0605..b87c635048de 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> +#include <sys/asan.h> #include <sys/buf.h> #include <sys/bus.h> #include <sys/cons.h> @@ -955,6 +956,18 @@ initarm(struct arm64_bootparams *abp) /* Do the same for reserve entries in the EFI MEMRESERVE table */ if (efi_systbl_phys != 0) exclude_efi_memreserve(efi_systbl_phys); + + /* + * We carefully bootstrap the sanitizer map after we've excluded + * absolutely everything else that could impact phys_avail. There's not + * always enough room for the initial shadow map after the kernel, so + * we'll end up searching for segments that we can safely use. Those + * segments also get excluded from phys_avail. + */ +#if defined(KASAN) + pmap_bootstrap_san(KERNBASE - abp->kern_delta); +#endif + physmem_init_kernel_globals(); devmap_bootstrap(0, NULL); @@ -998,6 +1011,7 @@ initarm(struct arm64_bootparams *abp) pan_enable(); kcsan_cpu_init(0); + kasan_init(); env = kern_getenv("kernelname"); if (env != NULL) |