From 677e030594aa51ea8d6304d24b7da2ecd7006fe8 Mon Sep 17 00:00:00 2001 From: Ming-Yi Lai Date: Wed, 10 Jan 2024 14:22:58 +0800 Subject: Zicfilp: Support delegating software check exception handling --- 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 728d671..b1f4b7d 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -906,6 +906,7 @@ bool medeleg_csr_t::unlogged_write(const reg_t val) noexcept { | (1 << CAUSE_LOAD_PAGE_FAULT) | (1 << CAUSE_STORE_PAGE_FAULT) | (proc->extension_enabled('H') ? hypervisor_exceptions : 0) + | (proc->extension_enabled(EXT_ZICFILP) ? (1 << CAUSE_SOFTWARE_CHECK_FAULT) : 0) ; return basic_csr_t::unlogged_write((read() & ~mask) | (val & mask)); } diff --git a/riscv/processor.cc b/riscv/processor.cc index 4f78879..165d7b9 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -382,7 +382,8 @@ void state_t::reset(processor_t* const proc, reg_t max_isa) (1 << CAUSE_USER_ECALL) | (1 << CAUSE_FETCH_PAGE_FAULT) | (1 << CAUSE_LOAD_PAGE_FAULT) | - (1 << CAUSE_STORE_PAGE_FAULT); + (1 << CAUSE_STORE_PAGE_FAULT) | + (1 << CAUSE_SOFTWARE_CHECK_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); -- cgit v1.1