Skip to content

[RFC] arch: arm: aarch32: make initial mpu configuration dynamic #35435

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

Closed
wants to merge 1 commit into from

Conversation

kumarnac
Copy link
Contributor

@kumarnac kumarnac commented May 19, 2021

Remove const from mpu configuraton to make initial configuration
set during runtime.

Signed-off-by: Nachiketa Kumar [email protected]

@github-actions github-actions bot added area: API Changes to public APIs area: ARM ARM (32-bit) Architecture labels May 19, 2021
@kumarnac kumarnac changed the title arch: arm: aarch32: make initial mpu configuration dynamic [RFC] arch: arm: aarch32: make initial mpu configuration dynamic May 19, 2021
@kumarnac
Copy link
Contributor Author

Further to discussions at #35212 RFC.

@najumon1980
Copy link
Collaborator

hi All,
the change is for use case related with flexible code relocation feature of Zephyr on different memory location. The application code which need to relocate should be update with corresponding MPU attribute once relocated. So during pre-kernel initialization (soc_init), dynamically update arm_mpu_config based on relocation information

Following are few justification for this:
a) In our controller, there is no flash memory and both code/data are reside in SRAM
b) The Kernel startup code will update the SRAM region to read only, execute only, read-write etc. based on the arm_mpu_config by programming MPU
c) the arm_mpu_config is only can be access from Kernel/supervisory mode
d) Also any kernel mode program can update the MPU to change a read only region(eg: arm_mpu_config) to any other memory attribute. That mean if a kernel mode code compromised then there is no protection to system resources.

Suggestion:
use KConfig which will declared arm_mpu_config as const or not. Default it will be declared as const which serve MCU which use Flash memory. For MCU which use SRAM only can define KConfig accordingly if required to make the arm_mpu_config modifiable from kernel mode code such soc_init.

Remove const from mpu configuraton to make initial configuration
set during runtime.

Signed-off-by: Nachiketa Kumar<[email protected]>
@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jul 19, 2021
@github-actions github-actions bot closed this Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: ARM ARM (32-bit) Architecture Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants