Fix crashes when multiple cpus are enabled - #1
Draft
vsatoes wants to merge 2 commits into
Draft
Conversation
A210 is T-Head C9xx-derived, but never registered the TLB-flush illegal-instruction trap fixup that thead-generic.c install via thead_register_tlb_flush_trap_handler(). Without it, an SBI_EXT_RFENCE remote-fence call could make a hart execute a TLB-invalidation instruction sequence that traps as illegal instruction on this core. Select THEAD_C9XX_ERRATA for PLATFORM_ZHIHE_A210 to pull in the fixup trap handler and call it on every hart branch, matching thead_generic_cold_boot_allowed()'s pattern. Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
vsatoes
marked this pull request as draft
August 26, 2026 14:25
SBI_PLATFORM_DEFAULT_HART_STACK_SIZE (8192) minus SBI_SCRATCH_SIZE (4096) left only ~4KB of usable M-mode stack per hart. On A210, when enabling multiple harts, a nested trap could overflow the 4KB budget into the adjacent hart's scratch/stack region. Bumping the default to 32768 gives ~28KB of usable per-hart stack, which was confirmed on A210 hardware to be more stable. Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
vsatoes
force-pushed
the
vsatoes/v1.5-a210
branch
from
August 28, 2026 14:05
49cfb88 to
755083f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.