diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -495,7 +495,6 @@ vm_page_t pmap_page_alloc_below_4g(bool zeroed); #if defined(KASAN) || defined(KMSAN) -void pmap_san_bootstrap(void); void pmap_san_enter(vm_offset_t); #endif diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -45,6 +45,11 @@ #define L3_PAGE_COUNT 32 #endif +/* + * The size of our bootstrap stack. + */ +#define BOOT_STACK_SIZE (KSTACK_PAGES * PAGE_SIZE) + .globl kernbase .set kernbase, KERNBASE @@ -147,7 +152,9 @@ mov x19, x0 /* Bootstrap an early shadow map for the boot stack. */ - bl pmap_san_bootstrap + ldr x0, [x0, #BP_KERN_STACK] + ldr x1, =BOOT_STACK_SIZE + bl kasan_init_early /* Restore bootparams */ mov x0, x19 @@ -880,7 +887,7 @@ .bss .align PAGE_SHIFT initstack: - .space (PAGE_SIZE * KSTACK_PAGES) + .space BOOT_STACK_SIZE initstack_end: .section .init_pagetable, "aw", %nobits diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -7864,12 +7864,6 @@ #if defined(KASAN) static pd_entry_t *pmap_san_early_l2; -void __nosanitizeaddress -pmap_san_bootstrap(struct arm64_bootparams *abp) -{ - kasan_init_early(abp->kern_stack, KSTACK_PAGES * PAGE_SIZE); -} - #define SAN_BOOTSTRAP_L2_SIZE (1 * L2_SIZE) #define SAN_BOOTSTRAP_SIZE (2 * PAGE_SIZE) static vm_offset_t __nosanitizeaddress diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -194,7 +194,6 @@ void pmap_bootstrap_san(void); void pmap_san_enter(vm_offset_t); -void pmap_san_bootstrap(struct arm64_bootparams *); #endif #endif /* _KERNEL */