Browse Source

csr: disable page fault delegation with nommu

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
pull/2126/head
Chih-Min Chao 9 months ago
committed by Andrew Waterman
parent
commit
7e8489f43e
  1. 11
      riscv/csrs.cc
  2. 1
      riscv/csrs.h

11
riscv/csrs.cc

@ -966,8 +966,11 @@ medeleg_csr_t::medeleg_csr_t(processor_t* const proc, const reg_t addr):
| (1 << CAUSE_FETCH_GUEST_PAGE_FAULT)
| (1 << CAUSE_LOAD_GUEST_PAGE_FAULT)
| (1 << CAUSE_VIRTUAL_INSTRUCTION)
| (1 << CAUSE_STORE_GUEST_PAGE_FAULT)
) {
| (1 << CAUSE_STORE_GUEST_PAGE_FAULT)),
mmu_exceptions(0
| (1 << CAUSE_FETCH_PAGE_FAULT)
| (1 << CAUSE_LOAD_PAGE_FAULT)
| (1 << CAUSE_STORE_PAGE_FAULT)) {
}
void medeleg_csr_t::verify_permissions(insn_t insn, bool write) const {
@ -988,9 +991,7 @@ bool medeleg_csr_t::unlogged_write(const reg_t val) noexcept {
| (1 << CAUSE_STORE_ACCESS)
| (1 << CAUSE_USER_ECALL)
| (1 << CAUSE_SUPERVISOR_ECALL)
| (1 << CAUSE_FETCH_PAGE_FAULT)
| (1 << CAUSE_LOAD_PAGE_FAULT)
| (1 << CAUSE_STORE_PAGE_FAULT)
| (proc->supports_impl(IMPL_MMU) ? mmu_exceptions : 0)
| (proc->extension_enabled('H') ? hypervisor_exceptions : 0)
| (1 << CAUSE_SOFTWARE_CHECK_FAULT)
| (1 << CAUSE_HARDWARE_ERROR_FAULT)

1
riscv/csrs.h

@ -468,6 +468,7 @@ class medeleg_csr_t: public basic_csr_t {
virtual bool unlogged_write(const reg_t val) noexcept override;
private:
const reg_t hypervisor_exceptions;
const reg_t mmu_exceptions;
};
class sip_csr_t: public mip_proxy_csr_t {

Loading…
Cancel
Save