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
cortex-m: Detect stack overflow #2002
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ppannuto
requested changes
Jul 6, 2020
bradjc
commented
Jul 7, 2020
brghena
reviewed
Jul 7, 2020
@tock/core-wg |
hudson-ayers
previously approved these changes
Jul 15, 2020
ppannuto
approved these changes
Jul 20, 2020
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+
2 tasks
bors bot
added a commit
that referenced
this pull request
Jul 31, 2020
2043: cortex-m: fix warning about volatile keyword in incorrect position r=bradjc a=hudson-ayers ### Pull Request Overview #2002 added a volatile keyword in the position intended for clobbers in the assembly responsible for resetting the stack pointer. This surfaced a warning whenever compiling a cortex-m4 architecture, but this warning did not cause CI to fail because `cd arch/ && RUSTFLAGS="-D warnings" cargo test` ignores code that can't be compiled on the host platform, and we do not deny warnings when compiling all boards. ### Testing Strategy This pull request was tested by compiling Imix and seeing that the warning is gone. ### TODO or Help Wanted Ideally we would deny warnings in `ci-job-compilation` so mistakes like this couldn't slip past CI, but passing `RUSTFLAGS="-D warnings"` to the call to `make allboards` within `ci-job-compilation` did not seem to work, and I did not try anything further. ### Documentation Updated - [x] No updates are required. ### Formatting - [x] Ran `make prepush`. Co-authored-by: Hudson Ayers <hayers@stanford.edu> Co-authored-by: Hudson Ayers <32688905+hudson-ayers@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This pull request adds logic to the kernel hardfault handler to detect a stack overflow condition, and resets the stack before using it. With IPC on hail I'm able to trigger this case and verify I get the panic handler.
This also moves the userland state saving down below since I'm not sure why that code was run in both the kernel and userspace fault case.
Fixes #1176.
Testing Strategy
Verifying that IPC on hail causes this panic handler to be displayed.
TODO or Help Wanted
Someone to look over the assembly.
I can copy to m3 once we are happy with it. I'm not sure this will work on cortex-m0 due to differences in the SCB.
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.