Page MenuHomeFreeBSD

arm64: Fix thread0.td_kstack_pages init
ClosedPublic

Authored by brooks on Jan 14 2023, 12:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 28 2024, 3:31 PM
Unknown Object (File)
Sep 28 2024, 1:20 PM
Unknown Object (File)
Sep 27 2024, 12:47 PM
Unknown Object (File)
Sep 24 2024, 12:24 AM
Unknown Object (File)
Sep 23 2024, 6:17 AM
Unknown Object (File)
Sep 20 2024, 10:34 AM
Unknown Object (File)
Sep 18 2024, 7:21 PM
Unknown Object (File)
Sep 17 2024, 6:40 PM
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.