-
Notifications
You must be signed in to change notification settings - Fork 747
boards: linker: remove MPU alignment #3198
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
As far as I know, the `MPU_MIN_ALIGN` alignment directive is very old in Tock, probably from a much simpler MPU implementation. I'm not sure why we still have it, as the MPU implementation should handle alignment, not the linker.
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 makes sense to me. The start of app memory can be at any possible address, and then the kernel can decide from there where it actually wants to grab chunks and allocate them based on MPU requirements.
Removing this would mean that I do think this would break anyone that statically places applications (cc @jettr / @a-pronin ) and uses our |
We could set the alignment to 256 bytes on cortex-m platforms, so that it is technically possible it could be used. However, that seems like something we would do since we already have the variable, and not something we would add if this variable had never existed. |
If |
We don't necessarily want to preclude users from putting in other sections by embedding assumptions about where app mem starts. |
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.
LGTM
bors r+ I dug back in history a bit: it looks like this dates back to when userland was in this repo and built together, and it was used to place the beginning of applications. Definitely not needed now :) |
As far as I know, the
MPU_MIN_ALIGN
alignment directive is very old in Tock, probably from a much simpler MPU implementation. I'm not sure why we still have it, as the MPU implementation should handle alignment, not the linker.Testing Strategy
I tested this on hail, and the MPU app memory code sets up the same regions before and after this change since the mpu implementation first sets the region to a power of two and then aligns to that region size.
TODO or Help Wanted
Does this cause any issue for RISC-V platforms?
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.