Skip to content
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

v7M MPU is enabled too early #380

Open
nchong opened this issue Dec 5, 2016 · 1 comment
Open

v7M MPU is enabled too early #380

nchong opened this issue Dec 5, 2016 · 1 comment
Labels

Comments

@nchong
Copy link

nchong commented Dec 5, 2016

During the initialisation of the vmpu in the procedure vmpu_init_post:

  1. The MPU is enabled by vmpu_arch_init() which calls vmpu_mpu_lock()
  2. Box configurations are loaded and regions are programmed for box 0 by vmpu_load_box()

This means that the MPU is enabled at (1) and subsequently has regions programmed at (2). At (1), only static regions will have been programmed. In particular, higher-numbered regions will still have their reset value (UNKNOWN); hence, this is architecturally UNPREDICTABLE.

A fix is to move the call to vmpu_mpu_lock() after vmpu_load_box(). This guarantees that all RBAR/RASR registers have been written-to (by vmpu_mpu_invalidate()) before the MPU is enabled.

Found using ArchEx.

@ciarmcom
Copy link
Member

ciarmcom commented Dec 5, 2016

ARM Internal Ref: IOTSEC-213

nchong pushed a commit to nchong/uvisor that referenced this issue Dec 20, 2016
See issue ARMmbed#380.

Move call to vmpu_mpu_lock() after vmpu_load_box(). This guarantees that all
RBAR/RASR registers have been written-to (by vmpu_mpu_invalidate()) before the
MPU is enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants