-
Notifications
You must be signed in to change notification settings - Fork 856
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
Ssdbltrp - VS mode double trap check #1799
Comments
@ved-rivos can you take a look at this? |
Yes. Thanks for spotting that.
I am not sure that is right. Please see use of nonvirtual_sstatus vs. sstatus in rest of the function. I sent a PR #1804 to swap it. @aswaterman please let me know if its right to just use sstatus->read(). Will it resolve to the sstatus or vstatus internally? |
@ved-rivos I'll follow up on the PR. |
@aswaterman - Thanks. I have updated the PR. |
In Spike's double trap check for VS/S mode, the current code accesses
state.nonvirtual_sstatus
in VS mode andstate.sstatus
in S mode.processor.cc#L447-L453
I think this reverses the intended access to the VS/S status registers, preventing the correct execution of double traps in VS mode.
Moreover, I think it might not be necessary to use curr_virt to select between VS and S status registers.
Spike inherently supports accessing
sstatus
based on the current virtualization mode, reading from eithersstatus
orvsstatus
as appropriate.Therefore, we might consider adjusting line 466 to:
reg_t s = state.sstatus->read();
The text was updated successfully, but these errors were encountered: