[doc] Add ePMP information

This commit is contained in:
Greg Chadwick 2021-01-11 10:53:47 +00:00
parent 374e05ec65
commit 8defdc4d6c
4 changed files with 41 additions and 1 deletions

View file

@ -9,6 +9,7 @@ It follows these specifications:
Ibex implements the Machine ISA version 1.11.
* `RISC-V External Debug Support, version 0.13.2 <https://content.riscv.org/wp-content/uploads/2019/03/riscv-debug-release.pdf>`_
* `RISC-V Bit Manipulation Extension, version 0.92 (draft from November 8, 2019) <https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf>`_
* :download:`PMP Enhancements for memory access and execution prevention on Machine mode <../03_reference/pdfs/riscv-epmp.pdf>`
Many features in the RISC-V specification are optional, and Ibex can be parametrized to enable or disable some of them.
@ -54,6 +55,8 @@ Ibex currently supports the following features according to the RISC-V Privilege
* Performance counters as described in :ref:`performance-counters`
* Vectorized trap handling as described at :ref:`exceptions-interrupts`
See :ref:`PMP Enhancements<pmp-enhancements>` for more information on Ibex's experimental and optional support for the PMP Enhancement proposal from the Trusted Execution Environment (TEE) working group.
.. rubric:: Footnotes
.. [#B_draft] Note that while Ibex fully implements draft version 0.92 of the RISC-V Bit Manipulation Extension, this extension may change before being ratified as a standard by the RISC-V Foundation.

View file

@ -34,6 +34,8 @@ Ibex implements all the Control and Status Registers (CSRs) listed in the follow
+---------+--------------------+--------+-----------------------------------------------+
| 0x344 | ``mip`` | R | Machine Interrupt Pending Register |
+---------+--------------------+--------+-----------------------------------------------+
| 0x390 | ``mseccfg`` | WARL | Machine Security Configuration |
+---------+--------------------+--------+-----------------------------------------------+
| 0x3A0 | ``pmpcfg0`` | WARL | PMP Configuration Register |
+---------+--------------------+--------+-----------------------------------------------+
| . . . . |
@ -246,6 +248,27 @@ A particular bit in the register reads as one if the corresponding interrupt inp
| 3 | **Machine Software Interrupt Pending (MSIP):** if set, ``irq_software_i`` is pending. |
+-------+---------------------------------------------------------------------------------------+
Machine Security Configuration (mseccfg)
----------------------------------------
CSR Address: ``0x390``
Reset Value: ``0x0000_0000``
+------+-----------------------------------------------------------------------------------------------------------------------------------+
| Bit# | Definition |
+------+-----------------------------------------------------------------------------------------------------------------------------------+
| 2 | **Rule Locking Bypass (RLB):** If set locked PMP entries can be modified |
+------+-----------------------------------------------------------------------------------------------------------------------------------+
| 1 | **Machine Mode Whitelist Policy (MMWP):** If set default policy for PMP is deny for M-Mode accesses that don't match a PMP region |
+------+-----------------------------------------------------------------------------------------------------------------------------------+
| 0 | **Machine Mode Lockdown (MML):** Alters behaviour of ``pmpcfgX`` bits |
+------+-----------------------------------------------------------------------------------------------------------------------------------+
``mseccfg`` is specified in the Trusted Execution Environment (TEE) working group proposal :download:`PMP Enhancements for memory access and execution prevention on Machine mode <../03_reference/pdfs/riscv-epmp.pdf>`, which gives the full details of it's functionality including the new PMP behaviour when ``mseccfg.MML`` is set.
Note that the reset value means PMP behavior out of reset matches the RISC-V Privileged Architecture.
A write to ``mseccfg`` is required to change it.
PMP Configuration Register (pmpcfgx)
------------------------------------

Binary file not shown.

View file

@ -3,7 +3,7 @@
Physical Memory Protection (PMP)
================================
The Physical Memory Protection (PMP) unit implements region-based memory access checking in-accordance with the RISC-V Privileged Specification, version 1.11.
The Physical Memory Protection (PMP) unit implements region-based memory access checking in-accordance with the RISC-V Privileged Specification, version 1.11 and includes the Trusted Execution Environment (TEE) working group proposal :download:`PMP Enhancements for memory access and execution prevention on Machine mode <pdfs/riscv-epmp.pdf>`.
The following configuration parameters are available to control PMP checking:
+----------------+---------------+----------------------------------------------------------+
@ -30,3 +30,17 @@ PMP Granularity
The PMP granularity parameter is used to reduce the size of the address matching comparators by increasing the minimum region size.
When the granularity is greater than zero, NA4 mode is not available and will be treated as OFF mode.
.. _pmp-enhancements:
PMP Enhancements
----------------
These are described in more detail in :download:`PMP Enhancements for memory access and execution prevention on Machine mode <pdfs/riscv-epmp.pdf>`.
If Ibex is configured to include PMP (PMPEnable is not zero) the PMP enhancements are always included.
Use of the enhanced behavior is optional, if no writes to ``mseccfg`` occur PMP behavior will remain exactly as specified in the RISC-V privileged specification.
The enhancements add:
* A new CSR ``mseccfg`` providing functionality to allow locked regions to be modified and to implement default deny for M-mode accesses.
* New PMP region configurations which are U-Mode or M-Mode accessible only with varying read/write/execute settings along with some shared U and M mode accessible configurations.
These new configurations supersede the original ones and are enabled via ``mseccfg``.