Skip to content

Commit 275c668

Browse files
committed
Fix WMASK of LCOFI bit(bit 13) in hvip
For implementations that support Smcdeleg/Ssccfg, Sscofpmf, Smaia/Ssaia, and the H extension, the LCOFI bit (bit 13) in each of hvip and hvien is implemented and writable.
1 parent eb0a3e2 commit 275c668

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

riscv/csrs.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,8 @@ reg_t hvip_csr_t::read() const noexcept {
18361836

18371837
bool hvip_csr_t::unlogged_write(const reg_t val) noexcept {
18381838
state->mip->write_with_mask(MIP_VSSIP, val); // hvip.VSSIP is an alias of mip.VSSIP
1839-
return basic_csr_t::unlogged_write(val & (MIP_VSEIP | MIP_VSTIP));
1839+
const reg_t lscof_int = proc->extension_enabled(EXT_SSCOFPMF) ? MIP_LCOFIP : 0;
1840+
return basic_csr_t::unlogged_write(val & (lscof_int | MIP_VSEIP | MIP_VSTIP));
18401841
}
18411842

18421843
ssp_csr_t::ssp_csr_t(processor_t* const proc, const reg_t addr, const reg_t mask, const reg_t init):

0 commit comments

Comments
 (0)