riscv-software-src / riscv-software-src/opensbi
pmp-granularity detection assumes pmpcfg is reset to 0
Open
@atishp04 is already working on this.
Since Oct 10, 2021.
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 712
- PR merge metrics
- No merged PRs in 30d
Description
The current method for checking pmp granularity is to write all ones to the pmpaddr0 and then checking the number of trailing zeros on a read of the same csr. However, this only works if the pmpcfg0.A as been configured to TOR or OFF. But reset values of pmpcfg.A is implementation defined. For example, Spike resets all the pmpcfg.A to NAPOT. Which means the lower order bits will all be read as ones instead of zeros.
Thus opensbi needs to first set pmpcfg0.A to 0 and then check for trailing zeros in pmpaddr0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.