-
Notifications
You must be signed in to change notification settings - Fork 7k
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
ARMv8-M: memory protection implementation #8018
Comments
@carlescufi @agross-linaro |
Some more detailed comments regarding the architectural changes we need:
|
We need to consider the execute bit as well. Current policy has XIP systems in mind. Currently, at least with the arm_mpu, the "background" map is RWX for supervisor and no access to user. Since we can't have overlapping regions in SRAM, is there a way to disable execution in the background map for ARMv8? And then just enable execution for the flash region? Also keep in mind that the MPU is also used to set cacheablility settings for at least arm_mpu, but armv8 may be different. |
@andrewboie, thanks for your feedback
As far as I know the only way to do these, is to define explicit MPU regions. But then, for SRAM this region would overlap with dynamically configured regions, e.g. for User-space, Stack-Guards etc. For Flash, we can define RX for both user and supervisor, I believe, since we do not expect to dynamically configure any regions. |
Pull-request for the driver implementation: #8785. |
Pull-request for migration into the new logging system: #9361 |
The non-overlapping MPU regions' issue is handler in #8907 |
Pull-request for non-overlapping MPU regions: #11346 |
ARM MPU for ARMv8-M
There are architectural changes in ARMv8-M.
There are register API changes
i. TYPE
ii. CTRL
iii. RNR
i. RBAR: Contains the Base Address (present in ARMv7), does not contain REGION and VALID (present in ARMv7), and contains attributes (not present in ARMv7)
i. RLAR
i. RASR
The possible permission-configuration options are limited in ARMv8
a. the Privileged-RW/Unprivileged-RO does not exist
b. the No-Access does not exist
Ensure that the ARM_MPU driver uses CMSIS directly, instead of defining own macros and HAL register APIs.
Adapt the ARM_MPU driver (HAL access), so it works both for ARMv7-M and ARMv8-M architectures. Ideally, we need to have 2ARM MPU drivers, with common (internal) APIs.
Ensure that only one of the source files is used in the build, depending on the supported MPU variant.
Refactor the ARM MPU internal API (e.g. macros for region/attribute definitions), so it can work with both architectures.
MPU configuration for memory caching for ARMv8-M
Ensure that the architectural differences of the 2 different MPU versions are taken into consideration when performing runtime MPU configurations in Zephyr
Ensure that active MPU regions never overlap with each other
Migrate the MPU driver to the new logging system
Update samples and tests in the tree to be able to run for ARMv8-M (e.g. available access permissions configuration)
The text was updated successfully, but these errors were encountered: