Therefore, each delegate trap will write inside SPP of mstatus the current privileged mode (the mode that was active prior to the trap)?
Since each trap normally goes back to M mode then unless it is delegated to the appropriate privileged mode, from each mode a trap can change to any other mode?
Hello Greg,
Thank you very much for your reply!
Just to make sure I understood, it would be really bad to teach
the wrong information.
Inside mstatus MPP[1:0] can hold any privileged mode, SPP[0:0] can
hold just S or U modes, and there is no UPP since this is the
lowest privileged mode and we can't return to a higher privileged
mode using a lower privileged return.
xRET:
- When SRET is executed should SPP bit from both mstatus and
sstatus change?
- MRET can be executed in any mode, SRET just in S mode or U mode,
URET just in U mode?
- MRET can walk M, S, or U, SRET can walk S, or U, URET just U
mode? (walk -> move between, from/to)
- SRET will not affect MPP bits, just MRET? Each xRET changes just
the xPP bit, MRET -> MPP, SRET -> SPP, URET -> None
(lower privileged mode)?
- On xRET the jump PC will be xEPC.
ECALL:
- There is only 1 encoding for ECALL (the one from unprivileged
spec)?
- ECALL will trigger a normal trap that can be delegated, unless
it is delegated it will be changed to M mode and executed there?
- To delegate the ECALL bits 8, 9, 11 from medeleg will enable
ECALL delegation, these bits will make the ECALL mode agnostic,
eg. the bit 9 is set all the ECALLs will jump to S mode?
Thank you very much!
Best regards,
JK
Hello Greg,
Thank you very much for your reply!
Just to make sure I understood, it would be really bad to teach the wrong information.
Inside mstatus MPP[1:0] can hold any privileged mode, SPP[0:0] can hold just S or U modes, and there is no UPP since this is the lowest privileged mode and we can't return to a higher privileged mode using a lower privileged return.
xRET:
- When SRET is executed should SPP bit from both mstatus and sstatus change?
- MRET can be executed in any mode, SRET just in S mode or U mode, URET just in U mode?
- MRET can walk M, S, or U, SRET can walk S, or U, URET just U mode? (walk -> move between, from/to)
- SRET will not affect MPP bits, just MRET? Each xRET changes just the xPP bit, MRET -> MPP, SRET -> SPP, URET -> None (lower privileged mode)?
- On xRET the jump PC will be xEPC.
ECALL:
- There is only 1 encoding for ECALL (the one from unprivileged spec)?
- ECALL will trigger a normal trap that can be delegated, unless it is delegated it will be changed to M mode and executed there?
- To delegate the ECALL bits 8, 9, 11 from medeleg will enable ECALL delegation, these bits will make the ECALL mode agnostic, eg. the bit 9 is set all the ECALLs will jump to S mode?
Hello Greg,
Thank you very much for clarifying these!
Best regards,
Alin
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CA%2BQh7T%3DZafB6rk3s8Cz4vhZ%2B3mqS9h2foqORJbdCtJmJCR_xhw%40mail.gmail.com.
Hmm, URET no longer exists, does it?
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAF4tt%3DDBmTO34z0yLQh2eHEr5Y2fv%3DG1zq%3DJqfF%3DadYM%3DFG91w%40mail.gmail.com.
Good question, I was wondering why the U mode was moved out of the privileged spec, is URET no longer supported?
Would it be improper to ask for a DFD-like representation of privileged routines? (like mode changes, interrupts, virtual memory, etc...)
Is there any available on the Internet?
Best regards,
JK