diff options
Diffstat (limited to 'riscv/csrs.cc')
-rw-r--r-- | riscv/csrs.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index 2bd8b0d..31e05f2 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -180,7 +180,7 @@ bool pmpaddr_csr_t::subset_match(reg_t addr, reg_t len) const noexcept { return !(is_tor ? tor_homogeneous : napot_homogeneous); } -bool pmpaddr_csr_t::access_ok(access_type type, reg_t mode) const noexcept { +bool pmpaddr_csr_t::access_ok(access_type type, reg_t mode, bool hlvx) const noexcept { const bool cfgx = cfg & PMP_X; const bool cfgw = cfg & PMP_W; const bool cfgr = cfg & PMP_R; @@ -191,7 +191,7 @@ bool pmpaddr_csr_t::access_ok(access_type type, reg_t mode) const noexcept { const bool typer = type == LOAD; const bool typex = type == FETCH; const bool typew = type == STORE; - const bool normal_rwx = (typer && cfgr) || (typew && cfgw) || (typex && cfgx); + const bool normal_rwx = (typer && cfgr && (!hlvx || cfgx)) || (typew && cfgw) || (typex && cfgx); const bool mseccfg_mml = state->mseccfg->get_mml(); if (mseccfg_mml) { |