Index: head/sys/arm64/arm64/locore.S =================================================================== --- head/sys/arm64/arm64/locore.S +++ head/sys/arm64/arm64/locore.S @@ -179,8 +179,7 @@ mp_virtdone: ldr x4, =secondary_stacks mov x5, #(PAGE_SIZE * KSTACK_PAGES) - sub x1, x0, #1 - mul x5, x1, x5 + mul x5, x0, x5 add sp, x4, x5 b init_secondary Index: sys/arm64/arm64/locore.S =================================================================== --- sys/arm64/arm64/locore.S +++ sys/arm64/arm64/locore.S @@ -27,6 +27,7 @@ */ #include "assym.s" +#include "opt_kstack_pages.h" #include #include @@ -181,8 +182,7 @@ mp_virtdone: ldr x4, =secondary_stacks mov x5, #(PAGE_SIZE * KSTACK_PAGES) - sub x1, x0, #1 - mul x5, x1, x5 + mul x5, x0, x5 add sp, x4, x5 b init_secondary