Page MenuHomeFreeBSD

arm64: Fix thread0.td_kstack_pages init
ClosedPublic

Authored by brooks on Jan 14 2023, 12:02 AM.
Tags
None
Referenced Files
F97029192: D38048.diff
Fri, Sep 27, 12:47 PM
Unknown Object (File)
Tue, Sep 24, 12:24 AM
Unknown Object (File)
Mon, Sep 23, 6:17 AM
Unknown Object (File)
Fri, Sep 20, 10:34 AM
Unknown Object (File)
Wed, Sep 18, 7:21 PM
Unknown Object (File)
Tue, Sep 17, 6:40 PM
Unknown Object (File)
Tue, Sep 17, 1:20 PM
Unknown Object (File)
Sat, Sep 14, 3:29 AM
Subscribers

Details

Summary

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.

Sponsored by: DARPA, AFRL

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Matches what other architectures do. We set kstack_pages to KSTACK_PAGES in kern/kern_proc.c, and it properly includes opt_kstack_pages.h, as does arm64/locore.S where we reserve the space.

This revision is now accepted and ready to land.Jan 14 2023, 12:13 AM
This comment was removed by markj.
This revision was automatically updated to reflect the committed changes.