[should rebase & merge] 6 commits for align nemu with nutshell - #286
Merged
Merged
Conversation
poemonsense
approved these changes
Sep 20, 2026
The four pmpcfg/pmpaddr stubs were writable but never checked. OpenSBI 1.9 sees them and fails isolation. Removing the CSRs is spec-legal (zero PMP) and lets firmware treat PMP as absent.
medeleg[11] (environment call from M-mode) was writable. The privileged spec makes it read-only zero; it cannot be delegated. Bits 18 and 19 (software-check / hardware-error) stay WARL even though NutShell does not implement those exceptions, so firmware writes to the full mask are not dropped.
The spec allows xtval to be 0 or the faulting PC on a breakpoint exception. Write the PC so DiffTest matches NEMU.
Do not implement the unprivileged cycle/time/instret CSRs. Keep mcounteren/scounteren bits 0-2 writable so OpenSBI can trap-and-emulate rdtime. Leave HPM bits read-only zero.
U-mode requires the envcfg CSRs. NutShell implements none of the controlled extensions, so every field is hardwired zero. mseccfg stays unimplemented.
Rebuild from NEMU riscv64-nutshell-ref on master plus the NutShell CSR PRs: no PMP/PMA/Zicntr/Zihpm/mseccfg, keep menvcfg/senvcfg, and CY/TM/IR writable in mcounteren.
good-circle
force-pushed
the
circle-patch9
branch
from
September 22, 2026 03:27
cd5f17a to
b5a88a1
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.