Skip to content
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

clarify writes to dinfc #417

Merged
merged 4 commits into from
Oct 14, 2024
Merged

Conversation

tariqkurd-repo
Copy link
Collaborator

Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need to restrict it to infinite caps, but might make more sense?

Alternatively I'd suggest using permissions encoding includes the <<m_bit>> instead of has a valid <<m_bit>>.

src/debug-integration.adoc Outdated Show resolved Hide resolved
src/debug-integration.adoc Outdated Show resolved Hide resolved
@tariqkurd-repo
Copy link
Collaborator Author

tariqkurd-repo commented Oct 11, 2024

We've had an internal review on this, and what it would really take to be able to write debug software.

Note that the previous spec didn't specify whether MODESW.* updated the execution of the next instruction, or delayed the update to the next entry into debug mode - so this is now specified as part of the commit.

We spent some time discussing how to update dinfc, as checking for a full infinite-cap is quite expensive in hardware.
Our conclusion was to not update dinfc, and require MODESW.* in debug mode

The point is that not requiring MODESW.* means that the debugger won't be able to rely on them. It will have to try and execute one, see if it gets an error and then fall back to doing the CSR RMW sequence to update dinfc. Or just not bother with them at all, in which case they are a waste of time.

So we've gone for the simple approach of requiring them, having them update M in dinfc, and making that observable by reading dinfc. This gives us a single simple mechanism for controlling the mode.

Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this simplification

@tariqkurd-repo tariqkurd-repo merged commit 012302c into riscv:main Oct 14, 2024
3 checks passed
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