Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alistair23
Copy link
Contributor

@alistair23 alistair23 commented Sep 9, 2022

Pull Request Overview

This is just the first few commits of #3056, focusing on the ePMP improvements to handle already configured ePMP regions.

See each commit for details

Testing Strategy

Tested as part of #3056

TODO or Help Wanted

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

We currently support detecting any number of ePMP regions by writing
values and seeing if the new value sticks. This allows us to support
multiple platforms, but it doesn't work if the bootloader has already
enabled MML.

This patch changes the behaviour if MML has been set, so that we ensure
we won't accidently lock ourselves out.

Signed-off-by: Alistair Francis <[email protected]>
A previous boot stage has enabled Machine Mode Whitelist Policy
(mseccfg.MMWP), which we can't disable. That means that Tock will
be denied a memory access if it doesn't match a PMP region
This eventually won't matter, as Tock configures it's own regions,
but it makes it difficult to setup.

To allow us to setup the ePMP regions without locking ourselves out
we create two special regions.

We create an allow all region as the first and last region.
This way no matter what the previous stage did, we should have a
working fallback while we modify the rules.
If the previous stage has an allow all in the first or last region,
we won't get locked out. If the previous stage created a range of
regions we also won't get locked out.

Signed-off-by: Alistair Francis <[email protected]>
@github-actions github-actions bot added arch/risc-v RISC-V architecture WG-OpenTitan In the purview of the OpenTitan working group. labels Sep 9, 2022
@bradjc
Copy link
Contributor

bradjc commented Sep 12, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 12, 2022

@bors bors bot merged commit f3cc2fa into tock:master Sep 12, 2022
@alistair23 alistair23 deleted the alistair/ot-bump-pre branch September 12, 2022 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch/risc-v RISC-V architecture WG-OpenTitan In the purview of the OpenTitan working group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants