Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstc: STIP and VSTIP of mip reverts behavior if xenvcfg.STCE=0
When menvcfg.STCE=0, mip.STIP reverts to its defined behavior as if unsupporting Sstc extension. When henvcfg.STCE=0, mip.VSTIP reverts to its defined behavior as if unsupporting Sstc extension. [riscvarchive/riscv-time-compare#5] The previous Sstc implementation does not respect the xenvcfg.STCE. In other words, the Sstc may assert mip.STIP (mip.VSTIP) when menvcfg.STCE=0 (henvcfg.STCE=0), which is a misbehaving. This commit presents a proposal that respects the xenvcf.STCE by utilizing the write mask of mip_csr_t::backdoor_write_with_mask() function. If menvcfg.STCE=0 (henvcfg.STCE=0), the corresponding bit of mip.STIP (mip.VSTIP) in the write mask should be 0 to revert the behavior as if unsupporting Sstec extension.
- Loading branch information