Skip to content

Commit

Permalink
fix(henvcfg): fix read value for CSR henvcfg.
Browse files Browse the repository at this point in the history
the CBIE, CBCFE, and CBZE fields of henvcfg should not depend on
the values of these three fields in menvcfg.
  • Loading branch information
NewPaulWalker committed Nov 27, 2024
1 parent 4922df4 commit cc8b7b9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/isa/riscv64/system/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,6 @@ static word_t csr_read(uint32_t csrid) {
case CSR_HENVCFG:
{
uint64_t henvcfg_out = henvcfg->val;
henvcfg_out &= menvcfg->val & MENVCFG_WMASK;
/* henvcfg.stce/dte/pbmte is read_only 0 when menvcfg.stce/dte/pbmte = 0 */
henvcfg_out &= menvcfg->val | ~(MENVCFG_RMASK_STCE | MENVCFG_RMASK_DTE | MENVCFG_RMASK_PBMTE);
return henvcfg_out & HENVCFG_WMASK;
Expand Down

0 comments on commit cc8b7b9

Please sign in to comment.