-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
non-overlapping MPU gap-filling needs to be optional #19067
Comments
@ioannisg would this be something you could look at, at least for ARMv8? |
@andrewboie in ARMv8-M, the reason for the gap-filling is to prevent supervisor mode to (accidentally) execute from SRAM (where, normally, it should have RW access only). We need MPU to block execution - the background policy unfortunately allows it. Also it is a nice debug issue that catches bugs, e.g. wrong pointer dereferencing (this is not a hard requirement of course). |
This is now done on ARM, still needs a PR for ARC. |
Fixed by #21050 |
ARMv8, and ARC MPU v3 are newer MPUs which allow for great flexibility on MPU region sizes, but regions are not allowed to overlap.
Currently, MPU regions are set up to control supervisor mode access, so that supervisor mode reads/writes to invalid memory generate faults. Implementing overlapping regions for memory domain requires that these base regions be split.
Unfortunately, this gap-filling has drawbacks:
The overhead can be looked at (see #15223) but halving the number of free regions may in a lot of cases be a dealbreaker for applications.
This gap-filling is NOT needed to properly support user mode. This is a feature to catch stray memory access in supervisor mode and is orthogonal to CONFIG_USERSPACE requirements.
Add a Kconfig option for these MPUs which allows this to be disabled, maximizing the number of memory domain partitions available to applications.
The text was updated successfully, but these errors were encountered: