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

rv32i: pmp: Remove power of two allignment constraint #1805

Merged
merged 1 commit into from Apr 30, 2020

Conversation

alistair23
Copy link
Contributor

Pull Request Overview

The TOR PMP implementation (the one we are using) does not require a
power of two size allignment so let's remove it to save space.

Testing Strategy

Running OpenTitan in QEMU with PMP enabled.

TODO or Help Wanted

Documentation Updated

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

Formatting

  • Ran make formatall.

The TOR PMP implementation (the one we are using) does not require a
power of two size allignment so let's remove it to save space.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@alistair23 alistair23 added the WG-OpenTitan In the purview of the OpenTitan working group. label Apr 28, 2020
Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next block makes this still okay, but it's getting dangerously close to running afoul of #1739

@alistair23
Copy link
Contributor Author

Are you worried we would have a size less then the pointer size, or not aligned to the pointer size?

The TOR PMP still needs to be 4byte aligned as we shift (>> 2) when writing to a register so we should be ok.

@ppannuto
Copy link
Member

I'm both not actually worried and worried that it won't be aligned to pointer size. Several other parts of the kernel assume that region boundaries are aligned to at least pointer width (see the recent series clippy / cast stuff). On the one hand, I really don't see it as likely for an MPU region to have granularity finer than pointer width; on the other hand, we c/would start having alignment issues if anything ever did that currently.

@bradjc bradjc merged commit 1f99412 into tock:master Apr 30, 2020
@alistair23 alistair23 deleted the alistair/pmp-fixes branch May 18, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WG-OpenTitan In the purview of the OpenTitan working group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants