aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2018-09-23 17:18:32 -0700
committerAndrew Waterman <andrew@sifive.com>2018-09-23 17:19:51 -0700
commit693ad48fc347bb613b95f6ebafc2e062428c5bd5 (patch)
tree2356416078ac99d3baf8bf47581c7317a064aefe
parent8b5fbe5f5d1acd134cba5ad6f26f59b71cebdb84 (diff)
downloadriscv-isa-manual-693ad48fc347bb613b95f6ebafc2e062428c5bd5.zip
riscv-isa-manual-693ad48fc347bb613b95f6ebafc2e062428c5bd5.tar.gz
riscv-isa-manual-693ad48fc347bb613b95f6ebafc2e062428c5bd5.tar.bz2
Fix an off-by-one error in defining coarse-grained PMPs for NAPOT
-rw-r--r--src/machine.tex13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/machine.tex b/src/machine.tex
index ca9abbc..7bebe67 100644
--- a/src/machine.tex
+++ b/src/machine.tex
@@ -2897,12 +2897,13 @@ PMP entry 0's A field is set to TOR, zero is used for the lower bound, and so
it matches any address $y < {\tt pmpaddr}_0$.
Although the PMP mechanism supports regions as small as four bytes, platforms
-may specify coarser PMP regions. In general, the PMP grain is
-$2^{G+2}$ bytes and must be the same across all PMP regions. When $G>0$, the
-NA4 mode may not be selected. Furthermore, bits ${\tt pmpaddr}_i$[G-1:0] all
-read as equal to ${\tt pmpcfg}_i$.A[1], i.e., all ones when the mode is NAPOT,
-or all zeros when the mode is TOR or OFF. Bits ${\tt pmpaddr}_i$[G-1:0] do
-not affect the address-matching logic.
+may specify coarser PMP regions. In general, the PMP grain is $2^{G+2}$ bytes
+and must be the same across all PMP regions. When $G \geq 1$, the NA4 mode
+may not be selected. When $G \geq 2$ and ${\tt pmpcfg}_i$.A[1] is set, i.e.
+the mode is NAPOT, then bits ${\tt pmpaddr}_i$[G-2:0] read as all ones. When
+$G \geq 1$ and ${\tt pmpcfg}_i$.A[1] is clear, i.e. the mode is OFF or TOR,
+then bits ${\tt pmpaddr}_i$[G-1:0] read as all zeros. Bits ${\tt
+pmpaddr}_i$[G-1:0] do not affect the TOR address-matching logic.
\begin{commentary}
Software may determine the PMP granularity by writing zero to {\tt pmp0cfg},