Browse Source

excp: support hardware_error_exception delegation

enable M -> S and HS -> VU/VS  delegation
pull/1735/head
Binno 2 years ago
committed by Chih-Min Chao
parent
commit
08463028d6
  1. 1
      riscv/csrs.cc
  2. 3
      riscv/processor.cc

1
riscv/csrs.cc

@ -930,6 +930,7 @@ bool medeleg_csr_t::unlogged_write(const reg_t val) noexcept {
| (1 << CAUSE_STORE_PAGE_FAULT)
| (proc->extension_enabled('H') ? hypervisor_exceptions : 0)
| (1 << CAUSE_SOFTWARE_CHECK_FAULT)
| (1 << CAUSE_HARDWARE_ERROR_FAULT)
;
return basic_csr_t::unlogged_write((read() & ~mask) | (val & mask));
}

3
riscv/processor.cc

@ -318,7 +318,8 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)
(1 << CAUSE_FETCH_PAGE_FAULT) |
(1 << CAUSE_LOAD_PAGE_FAULT) |
(1 << CAUSE_STORE_PAGE_FAULT) |
(1 << CAUSE_SOFTWARE_CHECK_FAULT);
(1 << CAUSE_SOFTWARE_CHECK_FAULT) |
(1 << CAUSE_HARDWARE_ERROR_FAULT);
csrmap[CSR_HEDELEG] = hedeleg = std::make_shared<masked_csr_t>(proc, CSR_HEDELEG, hedeleg_mask, 0);
csrmap[CSR_HCOUNTEREN] = hcounteren = std::make_shared<masked_csr_t>(proc, CSR_HCOUNTEREN, counteren_mask, 0);
htimedelta = std::make_shared<basic_csr_t>(proc, CSR_HTIMEDELTA, 0);

Loading…
Cancel
Save