riscv: Assert that SUM is not set in SSTATUS for exceptions.
Reviewed by: mhorne Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D29764
This commit is contained in:
parent
753bcca440
commit
6a3a6fe34b
@ -274,6 +274,9 @@ do_trap_supervisor(struct trapframe *frame)
|
||||
KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) ==
|
||||
SSTATUS_SPP, ("Came from S mode with interrupts enabled"));
|
||||
|
||||
KASSERT((csr_read(sstatus) & (SSTATUS_SUM)) == 0,
|
||||
("Came from S mode with SUM enabled"));
|
||||
|
||||
exception = frame->tf_scause & SCAUSE_CODE;
|
||||
if ((frame->tf_scause & SCAUSE_INTR) != 0) {
|
||||
/* Interrupt */
|
||||
@ -342,6 +345,9 @@ do_trap_user(struct trapframe *frame)
|
||||
KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0,
|
||||
("Came from U mode with interrupts enabled"));
|
||||
|
||||
KASSERT((csr_read(sstatus) & (SSTATUS_SUM)) == 0,
|
||||
("Came from U mode with SUM enabled"));
|
||||
|
||||
exception = frame->tf_scause & SCAUSE_CODE;
|
||||
if ((frame->tf_scause & SCAUSE_INTR) != 0) {
|
||||
/* Interrupt */
|
||||
|
Loading…
Reference in New Issue
Block a user