Skip to content

[should rebase & merge] 6 commits for align nemu with nutshell - #286

Merged
poemonsense merged 6 commits into
masterfrom
circle-patch9
Sep 22, 2026
Merged

poemonsense merged 6 commits into
masterfrom
circle-patch9

Conversation

@good-circle

Copy link
Copy Markdown
Collaborator

No description provided.

@good-circle good-circle changed the title 5 commits for align nemu with nutshell [should rebase & merge] 5 commits for align nemu with nutshell Sep 21, 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 good-circle changed the title [should rebase & merge] 5 commits for align nemu with nutshell [should rebase & merge] 6 commits for align nemu with nutshell Sep 22, 2026
@poemonsense
poemonsense merged commit 841b825 into master Sep 22, 2026
1 check passed
@poemonsense
poemonsense deleted the circle-patch9 branch September 22, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants