-
-
Notifications
You must be signed in to change notification settings - Fork 779
Grant: Enter grants before initializing their contents #3076
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
|
Need rebase now that #2958 is merged. |
0c7f917 to
f6adf9d
Compare
|
After running tests on Imix with multiple applications, this seems to have broken something (or at least changed timing enough to reveal something already broken in the |
|
This bug is really nasty, and I am not sure if it is the fault of this PR at all. A few things I have tried:
All of these results are repeatable. Moving the app to a different location in memory by flashing other apps before it does not seem to fix things. An interesting process_console printout from the failed version: |
|
To reproduce:
Also note:
Giving up for now, but I was able to make two versions of the analog comparator test app that differ in one instruction where one causes the error and the other doesn't. Basically inserting one meaningless instruction before the Any changes to the app or kernel seem to make the error go away. Best ideas so far:
|
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.
But I think the main takeaway is that this bug doesn't seem to have anything to do with this PR, and we should move this discussion to an issue and move forward with this PR.
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.
These changes look good to me.
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.
bors r+
Agreed, this changeset makes sense and looks good.
|
Note: Issue migrated to #3109 |
Pull Request Overview
This pull request is
just a single commit that builds on #2958 and should not be reviewed until #2958 is mergedis ready for review.This pull request modifies the grant code and process interface in two ways. First, it modifies
Process::enter_grant()to return aNonNull<u8>, since a null grant pointer should not be possible. Second, it modifiesallocate_grant()to no longer return a pointer, and instead return aboolindicating success or failure. This requires the code which allocates and initializes grants to actually enter the grant before it initializes its contents. This is important because otherwise dropping theEnterGrantKernelManagedLayoutstruct after initializing causes a call toleave_grant()for a grant that has not been entered at all, which does not make sense.Testing Strategy
This PR works fine, except for a specific app (analog_comparator) when flashed from a Linux host, but I am pretty confident that bug is unrelated to this PR.
TODO or Help Wanted
N/A
Documentation Updated
/docs, or no updates are required.Formatting
make prepush.