Skip to content

riscv: Mask unsupported menvcfg fields#33

Open
whensun wants to merge 1 commit into
antmicro:masterfrom
whensun:renode-menvcfg-masking
Open

riscv: Mask unsupported menvcfg fields#33
whensun wants to merge 1 commit into
antmicro:masterfrom
whensun:renode-menvcfg-masking

Conversation

@whensun

@whensun whensun commented Jul 6, 2026

Copy link
Copy Markdown

This patch prevents unsupported menvcfg fields from being stored and read back as writable ones.

The following fields are masked because their related functionality is not implemented by tlib:

  • STCE, related to Sstc
  • PBMTE, related to Svpbmt
  • CDE, related to Smcdeleg
  • PMM, related to Smnpm
  • CBZE, related to Zicboz
  • CBCFE and CBIE, related to Zicbom

These fields are required to remain read-only zero when their related extensions are not implemented.

The patch also makes menvcfgh available only on RV32 and rejects access to both CSRs when U-mode is not supported.

ADUE is intentionally not changed in this patch. TLib already performs automatic PTE A/D-bit updates, but this behavior is not currently controlled by menvcfg.ADUE.

Related to renode/renode#904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant