Skip to content

Commit

Permalink
Fix the init value for mideleg: always delegate VS interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmikhalevich committed Jun 19, 2023
1 parent e4417ff commit ac02322
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static NO_INLINE uint64_t raise_exception(STATE_ACCESS &a, uint64_t pc, uint64_t

template <typename STATE_ACCESS>
static inline uint32_t get_enabled_irq_mask_M(STATE_ACCESS &a, uint64_t mie, uint8_t priv) {
uint32_t deleg = ~a.read_mideleg() & ~MIP_VS_MASK;
uint32_t deleg = ~a.read_mideleg();
if (priv < PRV_M || (priv == PRV_M && mie)) { // enabled M
return deleg;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/riscv-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ enum CARTESI_init : uint64_t {
MIE_INIT = UINT64_C(0), ///< Initial value for mie
MIP_INIT = UINT64_C(0), ///< Initial value for mip
MEDELEG_INIT = UINT64_C(0), ///< Initial value for medeleg
MIDELEG_INIT = UINT64_C(0), ///< Initial value for mideleg
MIDELEG_INIT = UINT64_C(0x444), ///< Initial value for mideleg
MCOUNTEREN_INIT = UINT64_C(0), ///< Initial value for mcounteren
STVEC_INIT = UINT64_C(0), ///< Initial value for stvec
SSCRATCH_INIT = UINT64_C(0), ///< Initial value for sscratch
Expand Down

0 comments on commit ac02322

Please sign in to comment.