]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
arm64: Fix thread0.td_kstack_pages init
authorBrooks Davis <brooks@FreeBSD.org>
Tue, 17 Jan 2023 16:35:08 +0000 (16:35 +0000)
committerBrooks Davis <brooks@FreeBSD.org>
Tue, 17 Jan 2023 16:37:09 +0000 (16:37 +0000)
commite1b610f76caa09bbc3910477da878ea5078c6569
tree1e7a87a1f60811a6f8c9f7c7b280d01202f7fa73
parentc968598479917f52022b86d0089a9835ddcf2799
arm64: Fix thread0.td_kstack_pages init

Commit 86a994d6537d7b5e1efb1019e466d86a688fd570 initialized
thread0.td_kstack_pages to KSTACK_PAGES.  Due to the lack of an
include of opt_kstack_pages.h it used the fallback value of 4 from
machine/param.h.  This meant that increasing KSTACK_PAGES in the kernel
config resulted in a panic in _epoch_enter_preempt as the following
assertion was false during network stack setup:

        MPASS((vm_offset_t)et >= td->td_kstack &&
    (vm_offset_t)et + sizeof(struct epoch_tracker) <=
    td->td_kstack + td->td_kstack_pages * PAGE_SIZE);

Switch to initializing with kstack_pages following other architectures.

Reviewed by: imp, markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D38048
sys/arm64/arm64/machdep.c