Skip to content

rtl: el2_dec_pmp_ctl: Prevent using shared regions, while MML is unset - #527

Open
tmichalak wants to merge 2 commits into
mainfrom
update-mml-on-reserved-regions
Open

rtl: el2_dec_pmp_ctl: Prevent using shared regions, while MML is unset#527
tmichalak wants to merge 2 commits into
mainfrom
update-mml-on-reserved-regions

Conversation

@tmichalak

Copy link
Copy Markdown
Collaborator

The rationale behind this change, is that the RISC-V specification, explicitly marks the regions with the attributes R=0, W=1, as reserved, even if SMEPMP extension is implemented, as long as MML=0. To configure such regions, MML needs to be set. To configure Locked regions, it is possible to additionally use RLB, and reset it at the end of PMP configuration.

Since PMP registers are WARL (Write Any, Read Legal), if the config is reserved, it should not be read - so we clear the reserved bits.

Added tests to cover the above conditions.

The rationale behind this change, is that the RISC-V specification,
explicitly marks the regions with the attributes R=0, W=1, as reserved,
even if SMEPMP extension is implemented, as long as MML=0. To configure
such regions, MML needs to be set. To configure Locked regions, it is
possible to additionally use RLB, and reset it at the end of PMP
configuration.
Since PMP registers are WARL (Write Any, Read Legal), if the config is
reserved, it should not be read - so we clear the reserved bits.

Signed-off-by: Mateusz Karlic <mkarlic@antmicro.com>
Also fix typo `MML -> RLB` in one of the failure logs.

Signed-off-by: Mateusz Karlic <mkarlic@antmicro.com>
@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants