-
Notifications
You must be signed in to change notification settings - Fork 396
TB: update terminology to match paper & MiniRust #4595
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
Conversation
Thank you for contributing to Miri! |
/// For all non-accessed locations in the RangeMap (those that haven't had an | ||
/// implicit read), their SIFA must be weaker than or as weak as the SIFA of | ||
/// `default_perm`. | ||
/// `default_perm`; otherwise, this will panic. |
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.
@JoJoDeveloping I am actually a bit confused by this. The assertion looks as follows:
assert!(
default_strongest_idempotent
>= perm.permission.strongest_idempotent_foreign_access(protected)
);
This seems to run for all locations in initial_perms
, not just the non-accessed ones. Why that?
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.
It could be changed to the following, I think:
assert!(
perm.is_accessed()
|| default_strongest_idempotent
>= perm.permission.strongest_idempotent_foreign_access(protected)
);
But the way it is currently makes it easier to reason about because the SIFA correction can be proven correct without considering the initial read.
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.
Then we should update the comments to match, though.
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.
Instead of tracking this assertion all the way through, wouldn't it be easier to just compute the maximum SIFA and pass that to update_last_accessed_after_retag
? I've done that now in the 2nd commit, could you take a look if that makes sense?
4305e61
to
9591c61
Compare
{ | ||
assert!(perm.is_initial()); | ||
max_sifa = | ||
cmp::max(max_sifa, perm.permission.strongest_idempotent_foreign_access(protected)); |
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.
perm.permission.strongest_idempotent_foreign_access
is odd, isn't it? perm
already contains a SIFA. We should just read that.
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 think we could. If that field is wrongly initialized it is a bug anyways.
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.
Yeah my latest revision does that.
Looks reasonable now. |
Thanks for taking a look! |
No description provided.