-
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
Only implement one solution for native triggers. #1793
Only implement one solution for native triggers. #1793
Conversation
@YenHaoChen can you look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure whether we should implement a read-only 0 tcontorl in Solution 1 and could not find a direct answer from the spec.
The spec may want to keep the flexibility for hardware implementation. However, software would need a straight method to understand the hardware features for development. Additionally, from the hardware perspective, implementing an optional read-only 0 CSR increases costs without providing any beneficial features, and this does not make sense.
After another reading of the spec, I am convinced the modification does not violate the words of the spec.
Ping me once the two of you are in agreement, then I'll merge the PR. |
Good point. The spec is a bit messy here, and can use some clarification. The easy way to make it unambiguous what spike is doing is for tcontrol to not exist at all when S is implemented. |
389d820
to
566d2c0
Compare
Just force pushed no change to get the checks to start again. I'm pretty sure they failed because of some network issue. |
566d2c0
to
d4371d4
Compare
@rtwfroody Not a network problem; there's now a segfault when running a basic test on Spike. I checked this by rerunning CI locally. Here's what
|
@rtwfroody It looks like the issue might be related to writing tcontrol in |
I wonder why that's not happening for me. I rebased off of master just in case. Running spike with no arguments under gdb or valgrind report no issues whatsover. Anyway, I'll figure it out. |
Got it to reproduce. Typical user error... |
d4371d4
to
cfcbffd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. The functionality seems correct from my tests.
- The commit is big and could be broken down a little bit. Specifically, we could have a refactoring commit, which only changes the
allow_action()
function parameter. - I wonder whether we still need to check the tcontrol.mte in
common_match()
. - Solution 2 requires the
tcontrol
. We could use the existence oftcontrol
to decide which solution to use and guarantee that thetcontrol
exists in Solution 2.
e0ebf31
to
56e0204
Compare
Should the allow_action() logic really just be in common_match()? |
They are always called together, and now we get the previous privilege behavior in both.
When S-mode is present, use option 1 (disable triggers in M-mode unless MIE is set) from the Debug Spec. When S-mode is not present, use option 2 (implement mte and mpte bits in tcontrol). See discussion in riscv-software-src#1777.
56e0204
to
0703b44
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with this version, but I'll let @YenHaoChen sign off and click the merge button when he's ready.
The PR has addressed all of my comments. |
When S mode is present, use option 1 (disable triggers in M-Mode unless MIE is set) from the Debug Spec. When S mode is not present, use option 2 (implement mte and mpte bits in tcontrol).
See discussion in #1777.