-
-
Notifications
You must be signed in to change notification settings - Fork 779
Bind AppSlice to app instance (AppId), fixes #1914 #1933
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
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 documentation is a big bonus!
Will probably have to re-approve after fixing whatever is making the qemu ci test break.
kernel/src/mem.rs
Outdated
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.
Oh good catch!
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 can't request changes on my own PR so please view this as a change request. 😆
Edit: fixed.
f86a5af to
fcc9ec2
Compare
|
Given the potentially high impact of this, I'll try to run the release test suite today. I'm not expecting anything to fail, but this way we'd be on the safe side. |
[WIP] tests on nRF52840DK (and where failed Hail)(Explanations shamelessly stolen from @ppannuto's nRF52840DK testing of Release 1.5) I've changed the kernel to restart all apps in case of a fault and integrated the
[preliminary] conclusionAlthough I haven't conducted all tests yet, I'm fairly confident that this doesn't break anything fundamental. I can continue the tests, but don't want to block this any further. Any previously seen weird behavior is either reproducable on latest master (meaning I'll continue to investigate and potentially open other PRs/issues) or could be explained by integrating |
|
bors r+ |
2003: kernel: grant: do not pass T::default() r=alevy a=bradjc This changes how grant allocation is structured in grant.rs so that the allocation function does not take a copy of the data to be written when creating a new grant. This data can be large if the grant region is large, and it can cause a stack overflow when the allocate function is called. The change is pretty simple, but I'm not sure if there is some subtle reason to not do it this way. Fixes the IPC stack overflow issue found in #1933. Replaces #1976. ### Testing Strategy Running the hail app on hail. ### TODO or Help Wanted n/a ### Documentation Updated - [x] Updated the relevant files in `/docs`, or no updates are required. ### Formatting - [x] Ran `make prepush`. Co-authored-by: Brad Campbell <[email protected]>
Pull Request Overview
This pull request fixes #1914 by checking whether the memory an AppSlice points to still belongs to the same app instance (more precisely, the
instancefield inAppSlice).Thanks to @alevy for implementing the main part of this which turned out to be working perfectly. The commits on top make sure that the returned
AppSlicelength is consistent with theAsRefandAsMutimplementations and document this new behavior.Testing Strategy
This pull request was tested by developing a crude capsule which deliberately keeps an
AppSliceout of a grant and does not accept a secondallow. This ensures that the AppSlice is shared from the first app instance, but is used in the second app instance.The test capsule (integrated with the nRF52840) along the userspace
libtock_capp can be found here.The output validates that indeed the
AppSlicereturns a length of 0 and hands out a immutable / mutable slice of length0.TODO
We should probably run the release test suite along with the
DebugProcessRestartcapsule to make sure this doesn't break any existing capsules. I can verify this once this gets "yes, we indeed want this" feedback. 😄Documentation Updated
Updated the relevant files in
/docs, or no updates are required.I believe there not to be a section in
/docswhich needs to elaborate on this behavior. I hope the generated rustdoc is sufficient. If indeed an update in/docsis required, please provide pointers to the respective section.Formatting
make prepush.