-
Notifications
You must be signed in to change notification settings - Fork 840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smdbltrp - VS mode double trap check #1805
Comments
Smdbltrp is a ratified RISC-V standard, not something we can revise inside Spike. Anyway, the intent of the Smdbltrp extension is that exceptions that occur within an RNMI handler are definitionally "unexpected traps" that cause the processor to enter the critical-error state. cc @ved-rivos |
A RNMI may trap to the RNMI handler if |
In the double trap check for M-mode in Spike, the current logic transitions directly into a critical error whenever a double trap occurs (i.e.,
MDT
is set) or when a trap happens withnmie
being 0.process.cc#L510-L520
It seems that this approach might be slightly too broad, as any exception or interrupt delege to M-mode while
nmie
is 0 results in a critical error.However, since
nmie
only controls global interrupt enable, M-mode exceptions that are not double traps should still execute normally.With this in mind, it might be worth considering a revision to line 512 to:
if (get_field(s, MSTATUS_MDT) || (interrupt && !nmie))
.The text was updated successfully, but these errors were encountered: