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

PMP tests assume 4-byte granularity #580

Open
marcfedorow opened this issue Dec 18, 2024 · 3 comments
Open

PMP tests assume 4-byte granularity #580

marcfedorow opened this issue Dec 18, 2024 · 3 comments

Comments

@marcfedorow
Copy link
Contributor

#577 is just a special case of this problem.
Tests that check NA4 / NAPOT and do not set 'X' flag just trap and never finish because nothing is allowed to execute from the region that contains the test's code.
Still, other tests' signatures don't match because of the wrong accumptions (i.e. 4-byte granularity).

@allenjbaum
Copy link
Collaborator

allenjbaum commented Dec 18, 2024 via email

@marcfedorow
Copy link
Contributor Author

I believe that granularity should be checked by software.
RISC-V priv spec says:

Software may determine the PMP granularity by writing zero to pmp0cfg, then writing all ones
to pmpaddr0, then reading back pmpaddr0. If G is the index of the least-significant bit set, the
PMP granularity is 2^(G+2) bytes

@allenjbaum
Copy link
Collaborator

allenjbaum commented Dec 20, 2024 via email

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

No branches or pull requests

2 participants