@@ -16,78 +16,6 @@ definedBy:
1616 name : Smepmp
1717 version : ~> 1.0.0
1818fields :
19- MMsL :
20- location : 0
21- description : |
22- Machine Mode Lockdown (mseccfg.MML) enforces strong isolation between Machine Mode and lower-privilege modes. This is a _sticky bit_
23- meaning that once set, it can only be reset on PMP Reset.
24-
25- When `mseccfg.MML` is 1 (set), it redefines:
26-
27- a). `pmpcfg.L` bit as:
28-
29- - When `pmpcfg.L` is set, PMP rules are *enforced* on M-Mode only and *denied* on S/U-modes.
30-
31- - When `pmpcfg.L` is unset, PMP rules are *enforced* on S/U-modes-only and *denied* on M-mode.
32-
33- Formerly Reserved Encodings `pmpcfg.RW=01` and the encoding `pmpcfg.LRWX=1111` as *Shared-Region*.
34- A _Shared region Rule_ is *enforced* on all modes, with restrictions depending on the `pmpcfg.L` and `pmpcfg.X` bits as:
35-
36- - A _Shared-Region rule_ where `pmpcfg.L` is not set can be used for sharing data between M-mode and
37- S/U-mode, so is not executable. M-mode has read/write access to that region, and S/U-mode has
38- read access if `pmpcfg.X` is not set, or read/write access if `pmpcfg.X` is set.
39-
40- - A Shared-Region rule where `pmpcfg.L` is set can be used for sharing code between M-mode and
41- S/U-mode, so is not writeable. Both M-mode and S/U-mode have execute access on the region, and
42- M-mode also has read access if `pmpcfg.X` is set. The rule remains locked so that any further
43- modifications to its associated configuration or address registers are ignored until a PMP reset,
44- unless `mseccfg.RLB` is set.
45-
46- - The encoding `pmpcfg.LRWX=1111` can be used for sharing data between M-mode and S/U mode,
47- where both modes only have read-only access to the region. The rule remains locked so that any
48- further modifications to its associated configuration or address registers are ignored until a PMP
49- reset, unless `mseccfg.RLB` is set.
50-
51- b). Adding a rule with executable privileges that either is M-mode-only or a locked Shared-Region is not
52- possible and such `pmpcfg` writes are ignored, leaving `pmpcfg` unchanged. This restriction can be
53- temporarily lifted e.g. during the boot process, by setting mseccfg.RLB.
54-
55- c). Executing code with Machine mode privileges is only possible from memory regions with a matching M-
56- mode-only rule or a locked Shared-Region rule with executable privileges. Executing code from a
57- region without a matching rule or with a matching S/U-mode-only rule is *denied*.
58-
59- d). If `mseccfg.MML` is not set, the combination of `pmpcfg.RW=01` remains reserved for future standard use.
60-
61- The truth table when the `mseccfg.MML` is set:
62-
63- [cols="4*^.^1,2*^.^3", separator="!", %autowidth, options="header"]
64- !====
65- 4+^! Bits on _pmpcfg_ register 2+^! Result
66- ! L ! R ! W ! X ! M Mode ! S/U Mode
67-
68- ! 0 ! 0 ! 0 ! 0 2+^! Inaccessible region (Access Exception)
69- ! 0 ! 0 ! 0 ! 1 ! Access Exception ! Execute-only region
70- ! 0 ! 0 ! 1 ! 0 2+^! Shared data region: Read/write on M mode, Read-only on S/U mode
71- ! 0 ! 0 ! 1 ! 1 2+^! Shared data region: Read/write for both M and S/U mode
72- ! 0 ! 1 ! 0 ! 0 ! Access Exception ! Read-only region
73- ! 0 ! 1 ! 0 ! 1 ! Access Exception ! Read/Execute region
74- ! 0 ! 1 ! 1 ! 0 ! Access Exception ! Read/Write region
75- ! 0 ! 1 ! 1 ! 1 ! Access Exception ! Read/Write/Execute region
76- ! 1 ! 0 ! 0 ! 0 2+^! Locked inaccessible region* (Access Exception)
77- ! 1 ! 0 ! 0 ! 1 ! Locked Execute-only region* ! Access Exception
78- ! 1 ! 0 ! 1 ! 0 2+^! Locked Shared code region: Execute only on both M and S/U mode.*
79- ! 1 ! 0 ! 1 ! 1 2+^! Locked Shared code region: Execute only on S/U mode, read/execute on M mode.*
80- ! 1 ! 1 ! 0 ! 0 ! Locked Read-only region* ! Access Exception
81- ! 1 ! 1 ! 0 ! 1 ! Locked Read/Execute region* ! Access Exception
82- ! 1 ! 1 ! 1 ! 0 ! Locked Read/Write region* ! Access Exception
83- ! 1 ! 1 ! 1 ! 1 2+^! Locked Shared data region: Read only on both M and S/U mode.*
84- !====
85-
86- *Locked rules cannot be removed or modified until a PMP reset, unless mseccfg.RLB is set.
87-
88- type : RW
89- definedBy : Smepmp
90- reset_value : UNDEFINED_LEGAL
9119 MML :
9220 location : 0
9321 definedBy : Smepmp
0 commit comments