-
Notifications
You must be signed in to change notification settings - Fork 665
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
Zcmt: clarify translation of jvt-based addresses in M-mode #1609
Comments
I think the description could be worded more artfully, but the answer to your question is unambiguous, because MPRV is defined to affect only explicit memory accesses. |
Thank you for the definitive answer, that clears up my question nicely.
Thanks, I went looking for that definition of MPRV, because that is a highly useful distinction and covers this neatly. The nearest I could find was this table caption in the section on the hypervisor extension:
If MPRV only affects explicit accesses (and not implicit ones) then would it be possible to add words to that effect to the documentation of The machine ISA description I'm referring to is 3.1.6.4:
|
The Zcmt spec makes it clear that JVT accesses are considered implicit accesses. We can't aggregate this information in one place because it would make the spec unscalable. The scalable approach is to define common terminology, then use that terminology in the extension specs. And that's exactly what we've done in this case. |
Agreed, this part is clear. I think the explicit/implicit distinction is a nice cut point and these terms are well defined. I don't see any reference to explicit/implicit accesses in the definition of |
The MPRV section was written before the explicit/implicit concept was defined, but you can read that section's use of the phrase "loads and stores" to mean the same thing as "explicit memory accesses". We'll get around to fixing it eventually, but for the moment, there's no ambiguity: "loads and stores" obviously excludes implicit memory accesses. |
The latest draft says this about
jvt
(and this seems to match the ratified PDF from theriscv-code-size-reduction
repo):The first paragraph seems ambiguous, because virtual memory is "enabled" separately for fetch and load/store/AMO. The second paragraph is a good hint but it's not clear whether this is describing the translation or just X permissions (including PMP).
My question is: are jvt-based accesses translated in M-mode when
mstatus.mprv
is set andmstatus.mpp
= S? If the intent is this is not translated then the first quoted sentence might be written more explicitly like so:This is relevant because M-mode routines manipulating S-mode memory may also be compiled with Zcmt jumps, using an M-mode-supplied
jvt
value.The text was updated successfully, but these errors were encountered: