From 08463028d68fe75d1bc59c9f20b9c86f8bd9f460 Mon Sep 17 00:00:00 2001 From: Binno Date: Thu, 11 Jul 2024 20:14:12 -0700 Subject: [PATCH] excp: support hardware_error_exception delegation enable M -> S and HS -> VU/VS delegation --- riscv/csrs.cc | 1 + riscv/processor.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/riscv/csrs.cc b/riscv/csrs.cc index 01720eb9..dcd25629 100644 --- a/riscv/csrs.cc +++ b/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)); } diff --git a/riscv/processor.cc b/riscv/processor.cc index 7a6989ea..7299548a 100644 --- a/riscv/processor.cc +++ b/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(proc, CSR_HEDELEG, hedeleg_mask, 0); csrmap[CSR_HCOUNTEREN] = hcounteren = std::make_shared(proc, CSR_HCOUNTEREN, counteren_mask, 0); htimedelta = std::make_shared(proc, CSR_HTIMEDELTA, 0);