From a8525b62430432c020bd01f1ce51d10f36cc8da3 Mon Sep 17 00:00:00 2001 From: Ved Shanbhogue Date: Thu, 12 Sep 2024 19:37:26 -0500 Subject: [PATCH] fix error in reading right sstatus --- riscv/processor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/processor.cc b/riscv/processor.cc index 60f6a89bc7..c4d8c0694c 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -446,7 +446,7 @@ void processor_t::take_trap(trap_t& t, reg_t epc) // An unexpected trap - a trap when SDT is 1 - traps to M-mode if ((state.prv <= PRV_S && bit < max_xlen) && (((vsdeleg >> bit) & 1) || ((hsdeleg >> bit) & 1))) { - reg_t s = curr_virt ? state.nonvirtual_sstatus->read() : state.sstatus->read(); + reg_t s = state.sstatus->read(); supv_double_trap = get_field(s, MSTATUS_SDT); if (supv_double_trap) vsdeleg = hsdeleg = 0;