From 259a402e2894b62374370bdbcdf5c4bdcd66f971 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Mon, 8 Aug 2022 23:08:31 +0100 Subject: [PATCH] Describe new pmpcfgm0 register --- doc/sections/csr.adoc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/sections/csr.adoc b/doc/sections/csr.adoc index 874bb9f..fe12eca 100644 --- a/doc/sections/csr.adoc +++ b/doc/sections/csr.adoc @@ -647,6 +647,27 @@ no_more_irqs: mret ---- +=== Custom Memory Protection CSRs + +==== mpmpcfgm0 + +Address: 0xbd0 + +PMP M-mode configuration. One bit per PMP region. Setting a bit makes the corresponding region apply to M-mode (like the `pmpcfg.L` bit) but does not lock the region. + +PMP is useful for non-security-related purposes, such as stack guarding and peripheral emulation. This extension allows M-mode to freely use any currently unlocked regions for its own purposes, without the inconvenience of having to lock them. + +Note that this does not grant any new capabilities to M-mode, since in the base standard it is already possible to apply unlocked regions to M-mode by locking them. In general, PMP regions should be locked in ascending region number order so they can't be subsequently overridden by currently unlocked regions. + +Note also that this is not the same as the "rule locking bypass" bit in the ePMP extension, which does not permit locked and unlocked M-mode regions to coexist. + +[cols="10h,20h,~", options="header"] +|=== +| Bits | Name | Description +| 31:16 | - | RES0 +| 15:0 | `m` | Regions apply to M-mode if this bit _or_ the corresponding `pmpcfg.L` bit is set. Regions are locked if and only if the corresponding `pmpcfg.L` bit is set. +|=== + === Custom Power Control CSRs ==== msleep