-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add missing PTE checks #387
Conversation
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.
IIRC these checks didn't used to be in the spec, so it's not that they're missing, it's that you want to make the model conform to a newer version of the priv spec?
a.V() == 0b0 | (a.W() == 0b1 & a.R() == 0b0) | ||
a.V() == 0b0 | | ||
(a.W() == 0b1 & a.R() == 0b0) | | ||
(ext != 0b0000000000) | |
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.
This breaks extensions (e.g. CHERI) that do assign meaning to these bits and exist as users of the Sail model
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.
If the base priv spec says we need to raise a page fault when these bits are non-zero, I'm not sure we can ignore it. Maybe we need to add some kind of mechanism so CHERI can override the behaviour of isInvalidPTE and similar functions with its own implementations?
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.
The privileged specification reserves these bits for future standard use. There are two extensions - Svpbmt and Svnapot - that use some of the bits that are not present in our golden reference model. The use of bits by extensions needs to be enabled by the governing xenvcfg
register. Not having these checks makes it a problem to use it as a golden reference as these mismatches need to be waived. I hope to provide the models for the other missing pieces in the virtual memory system architecture - Svnapot, Svpbmt, and Sv57 - and this bug fix is needed to build those. When CHERI becomes a standard extension I think it would follow the architecture and add the environment controls to enable the use of a subset of those bits that get allocated for CHERI use.
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.
Cheri isn't a ratified spec, it's being developed, so for the arch-test use
cases, it has to have that check.
So either we have to add a CLI switch that enables Cheri (i.e. disables
this check) & enables all the other Cheri functionality),
or Cheri development is done in a separate branch, right?
…On Thu, Jan 11, 2024 at 6:02 PM Jessica Clarke ***@***.***> wrote:
***@***.**** requested changes on this pull request.
IIRC these checks didn't used to be in the spec, so it's not that they're
missing, it's that you want to make the model conform to a newer version of
the priv spec?
------------------------------
In model/riscv_pte.sail
<#387 (comment)>:
> @@ -106,7 +106,10 @@ function isPTEPtr(p : pteAttribs, ext : extPte) -> bool = {
function isInvalidPTE(p : pteAttribs, ext : extPte) -> bool = {
let a = Mk_PTE_Bits(p);
- a.V() == 0b0 | (a.W() == 0b1 & a.R() == 0b0)
+ a.V() == 0b0 |
+ (a.W() == 0b1 & a.R() == 0b0) |
+ (ext != 0b0000000000) |
This breaks extensions (e.g. CHERI) that *do* assign meaning to these
bits and exist as users of the Sail model
—
Reply to this email directly, view it on GitHub
<#387 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJXEB62MULM5AEFMY23YOCKRXAVCNFSM6AAAAABBXMSJMOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMJXGIZTQNBWHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The PTE checking in the sail model is missing part of the following rule that requires raising a page fault if reserved bits are set:
All tests pass.