@@ -137,13 +137,13 @@ An `SRET` instruction sets the `SDT` bit to 0.
137
137
138
138
[NOTE]
139
139
====
140
- A trap handler after saving the state needed for resuming from the trap,
141
- including `scause `, `sepc`, and `stval` among others, should clear the `SDT` bit
142
- when it is reentrant .
140
+ After a trap handler has saved the state, such as `scause`, `sepc`,
141
+ and `stval `, needed for resuming from the trap and is reentrant, it
142
+ should clear the `SDT` bit .
143
143
144
- Resetting of the `SDT` by an ` SRET` enables the trap handler to detect double
145
- trap occuring during the tail phase, where it restores critical state to return
146
- from a trap.
144
+ Resetting the `SDT` by an SRET enables the trap handler to detect a double
145
+ trap that may occur during the tail phase, where it restores critical state
146
+ to return from a trap.
147
147
148
148
The consequence of this specification is that if a critical error condition was
149
149
caused by a guest page-fault, then the GPA will not be available in `mtval2`
@@ -154,7 +154,7 @@ instruction in this phase of trap handling is not common. However, not recording
154
154
the GPA is considered benign because, if required, it can still be obtained
155
155
-- albeit with added effort -- through the process of walking the page tables.
156
156
157
- For a double trap originating in VS-mode, M-mode should redirect the exception
157
+ For a double trap that originates in VS-mode, M-mode should redirect the exception
158
158
to HS-mode by copying the values of M-mode CSRs updated by the trap to HS-mode
159
159
CSRs and should use an `MRET` to resume execution at the address in `stvec`.
160
160
@@ -188,8 +188,8 @@ When a trap is to be taken into M-mode, if the `MDT` bit is currently 0, it is
188
188
then set to 1, and the trap is delivered as expected. However, if `MDT` is
189
189
already set to 1, then this is an _unexpected trap_. Additionally, when the
190
190
Smrnmi extension is implemented, a trap that occurs when executing in M-mode
191
- with the `mnstatus.NMIE` set to 0 is an _unexpected trap_. The handling of an
192
- _unexpected trap_ is as follows:
191
+ with the `mnstatus.NMIE` set to 0 is an _unexpected trap_. The _unexpected trap_
192
+ is handled as follows:
193
193
194
194
* When the Smrnmi extension is implemented and `mnstatus.NMIE` is 1, the hart
195
195
traps to the RNMI handler. To deliver this trap, the `mnepc` and `mncause`
@@ -200,24 +200,24 @@ _unexpected trap_ is as follows:
200
200
201
201
[NOTE]
202
202
====
203
- The consequence of this specification is that on occurrence of double trap the
204
- RNMI handler is not provided with information that a trap would report in the
205
- `mtval` and the `mtval2` registers. This information, if needed, may be obtained
203
+ The consequence of this specification is that on occurrence of double trap, the
204
+ RNMI handler is not provided with information that a trap reports in the
205
+ `mtval` and the `mtval2` registers. This information, if needed, can be obtained
206
206
by the RNMI handler by decoding the instruction at the address in `mnepc` and
207
207
examining its source register contents.
208
208
====
209
209
210
210
* When the Smrnmi extension is not implemented, or if the Smrnmi extension is
211
211
implemented and `mnstatus.NMIE` is 0, the hart enters a critical-error state
212
- without updating any architectural state including the `pc`. This state
212
+ without updating any architectural state, including the `pc`. This state
213
213
involves ceasing execution, disabling all interrupts (including NMIs), and
214
214
asserting a `critical-error` signal to the platform.
215
215
216
216
[NOTE]
217
217
====
218
- The actions performed by the platform on assertion of a `critical-error` signal
219
- by a hart are platform specific. The range of possible actions include restarting
220
- the affected hart or restarting the entire platform among others.
218
+ The actions performed by the platform when a hart asserts a `critical-error` signal
219
+ are platform- specific. The range of possible actions include restarting
220
+ the affected hart or restarting the entire platform, among others.
221
221
====
222
222
223
223
The `MRET` and `SRET` instructions set the `MDT` bit to 0.
@@ -238,10 +238,10 @@ than VS-mode, `vsstatus.SDT` is set to 0.
238
238
[NOTE]
239
239
====
240
240
The implication of this specification is that resuming from Debug Mode,
241
- following an entry due to a critical error, will either result in an immediate
241
+ following an entry due to a critical error will either result in an immediate
242
242
re-entry into Debug Mode due to the critical error if `cetrig` is set to 1, or
243
243
it will cause the critical-error signal to be asserted to the platform. The
244
- debugger may resume with `cetrig` set to 0 to allow the platform defined actions
244
+ debugger can resume with `cetrig` set to 0 to allow the platform- defined actions
245
245
on critical-error signal to occur. Other possible actions include initiating a
246
246
hart or platform reset using the Debug Module reset control.
247
247
====
0 commit comments