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 @@ -134,7 +134,7 @@ sub sp, sp, #BOOTPARAMS_SIZE mov x0, sp - /* Degate the delda so it is VA -> PA */ + /* Negate the delta so it is VA -> PA */ neg x29, x29 str x1, [x0, #BP_MODULEP] diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -26,6 +26,7 @@ */ #include "opt_acpi.h" +#include "opt_kstack_pages.h" #include "opt_platform.h" #include "opt_ddb.h" @@ -380,7 +381,7 @@ proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_kstack_pages = kstack_pages; + thread0.td_kstack_pages = KSTACK_PAGES; #if defined(PERTHREAD_SSP) thread0.td_md.md_canary = boot_canary; #endif diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -170,9 +170,13 @@ { TSENTER(); -#if !defined(__arm64__) + + /* + * arm64 and riscv currently hard code thread0 kstack to + * KSTACK_PAGES, ignoring the tunable. + */ TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); -#endif + hz = -1; TUNABLE_INT_FETCH("kern.hz", &hz); if (hz == -1) diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -33,6 +33,7 @@ * SUCH DAMAGE. */ +#include "opt_kstack_pages.h" #include "opt_platform.h" #include @@ -286,7 +287,7 @@ proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_kstack_pages = kstack_pages; + thread0.td_kstack_pages = KSTACK_PAGES; thread0.td_pcb = (struct pcb *)(thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_fpflags = 0;