Closed hwliu-tommy closed 1 year ago
This text was added to the clic spec in pull #340:
As stated in the RISC-V privilege specification,
when a trap is taken from privilege mode y into privilege mode x,
xPIE is set to the value of x IE; xIE is set to 0; and
xPP is set to y. xepc is written with the virtual address of the instruction
that was interrupted or that encountered the exception.
Additionally in CLIC mode, interrupt level (xpil
) is set to xstatus.xil and
xcause.exccode is written with a code indicating the event (the id of the
interrupt or exception code) that caused the trap.
Do we actually want mcause.mpil to be updated on exceptions (non-interrupts)? what if there is a breakpoint in an interrupt handler. after the breakpoint resumes, mcause.mpil would be wrong and need to be updated before resuming the breakpoint? Let's discuss in our TG meeting
Fix xstatus -> xintstatus
Text already covers exception case in section 4.9.4 "Synchronous Exception Handling". Debug mode is considered a more privileged mode than M, so breakpoint into debug mode is a vertical trap.
xstatus.xil to xintstatus.xil typo fixed. https://github.com/riscv/riscv-fast-interrupt/commit/79c6f119f2837cafeefa4e25751615815e5668f3
closing issue.
Hi,
I have 2 questions about the descriptions of xpil and xpie in section 4.7.6 and 4.10.1.
My interpretation is that when a M-mode interrupt is taken from S-mode, sil should be saved to mpil. And when MRET changes the privilege to S-mode, sil should be updated to mpil. Is this interpretation correct? Because the xie behavior in this case will be: on trap taken: mpie <- mie <- 0 on MRET: mie <- mpie
I have a suggestion that maybe we could define these behaviors as the xIE, xRET descriptions in privileged spec? For example: when a trap is taken from privilege mode y into privilege mode x, xPP = y. User can simply replace x, y with the corresponding privileges, I think it would be easier to understand the behavior.
Thanks, Tommy