Browse Source

Merge pull request #2281 from demin-han/master

Fix condition for setting critical_error
pull/2212/merge
Andrew Waterman 3 weeks ago
committed by GitHub
parent
commit
4bf7da7d73
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      riscv/processor.cc

4
riscv/processor.cc

@ -497,8 +497,8 @@ void processor_t::take_trap(trap_t& t, reg_t epc)
reg_t s = state.mstatus->read(); reg_t s = state.mstatus->read();
if ( extension_enabled(EXT_SMDBLTRP)) { if ( extension_enabled(EXT_SMDBLTRP)) {
if (get_field(s, MSTATUS_MDT) || !nmie) { if (get_field(s, MSTATUS_MDT) && (!state.mnstatus || !nmie)) {
// Critical error - Double trap in M-mode or trap when nmie is 0 // Critical error - Double trap in M-mode when Smrnmi not implemented or nmie is 0
// RNMI is not modeled else double trap in M-mode would trap to // RNMI is not modeled else double trap in M-mode would trap to
// RNMI handler instead of leading to a critical error // RNMI handler instead of leading to a critical error
state.critical_error = 1; state.critical_error = 1;

Loading…
Cancel
Save