From 8cacad662eea860f5c7d6d7844d6c4dd20c24ecb Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 26 Jun 2024 18:35:45 -0700 Subject: [PATCH] Add Smpmpmt draft --- src/priv/preface.adoc | 1 + src/priv/sm.adoc | 1 + src/priv/smpmpmt.adoc | 58 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 src/priv/smpmpmt.adoc diff --git a/src/priv/preface.adoc b/src/priv/preface.adoc index 89d42ecc4..ec0b7e68e 100644 --- a/src/priv/preface.adoc +++ b/src/priv/preface.adoc @@ -23,6 +23,7 @@ h|Extension h|Version |ext:smstateen[] |1.0 |ext:smcsrind[] |1.0 |ext:smepmp[] |1.0 +|ext:smpmpmt[] |1.0 |ext:smcntrpmf[] |1.0 |ext:smrnmi[] |1.0 |ext:smcdeleg[] |1.0 diff --git a/src/priv/sm.adoc b/src/priv/sm.adoc index cdb37ff7a..c0a143bb2 100644 --- a/src/priv/sm.adoc +++ b/src/priv/sm.adoc @@ -7,6 +7,7 @@ Its contents are normative, but the presentation might appear disjoint. include::smstateen.adoc[] include::smcsrind.adoc[] include::smepmp.adoc[] +include::smpmpmt.adoc[] include::smcntrpmf.adoc[] include::smrnmi.adoc[] include::smcdeleg.adoc[] diff --git a/src/priv/smpmpmt.adoc b/src/priv/smpmpmt.adoc new file mode 100644 index 000000000..2fadcd688 --- /dev/null +++ b/src/priv/smpmpmt.adoc @@ -0,0 +1,58 @@ +[[ext:smpmpmt]] +=== ext:smpmpmt[] PMP-based Memory Types Extension + +The extlink:svpbmt[] extension provides a mechanism to control memory +attributes at the granularity of a virtual-memory page. +Unfortunately, Svpbmt is only available for RV64, and only then when +page-based virtual memory is in effect. + +The Smpmpmt extension provides a mechanism analogous to Svpbmt but associated +with the PMP registers rather than page-table entries. +A new WARL field, MT (Memory Type), is added in the unallocated bits 6--5 in +each PMP configuration register. +The MT field of the lowest-numbered PMP register that an access matches, +following the existing PMP address-matching rules, overrides the PMAs for +that access. +If an access matches no PMP registers, or if the MT field of the matching PMP +register contains the value PMA, then the access proceeds as though the +Smpmpmt extension were not implemented. + +NOTE: The permissions checks associated with a PMP register are unrelated to +whether an access is considered to match a PMP register. +For example, even though a PMP register with its L bit clear does not enforce +its permissions checks on M-mode accesses, M-mode accesses within the +address range of that PMP register are still considered to match. +Hence, that PMP register's MT field takes effect for matching M-mode accesses. + +The MT field is encoded as shown in <>. +The encoding is identical to that of the PBMT field, and the meaning of each +type is as specified by the Svpbmt extension. +Refer to that specification for the semantics of each type. + +[[pmpmt]] +.Encodings for MT field +[%autowidth,float="center",align="center",cols="^,^,<",options="header"] +|=== +|Mode |Value |Requested Memory Attributes +|PMA + +NC + +IO + +- +|0 + +1 + +2 + +3 +|None + +Non-cacheable, idempotent, weakly-ordered (RVWMO), main memory + +Non-cacheable, non-idempotent, strongly-ordered (I/O ordering), I/O + +_Reserved for future standard use_ +|=== + +The PMP-based memory types compose with the page-based memory types as follows. +First, the PMP-based memory types override the PMAs, producing an intermediate +set of attributes. +Then, supervisor-level memory attributes (e.g. the page-based attributes +described in the Svpbmt specification) override the intermediate attributes to +produce a final set of attributes. +As with Svpbmt, it is implementation-defined whether PMP-based memory types +override additional PMAs not explicitly listed in <>.