Skip to content

Fix scountovf read behavior in M-mode according to RISC-V Privileged SpecFix scountovf read behavior in M-mode according to RISC-V Privileged …#2243

Open
chillakalyan wants to merge 1 commit intoriscv-software-src:masterfrom
chillakalyan:fix-scountovf
Open

Fix scountovf read behavior in M-mode according to RISC-V Privileged SpecFix scountovf read behavior in M-mode according to RISC-V Privileged …#2243
chillakalyan wants to merge 1 commit intoriscv-software-src:masterfrom
chillakalyan:fix-scountovf

Conversation

@chillakalyan
Copy link
Copy Markdown

According to the RISC-V Privileged Specification, scountovf bits should
always be readable in M-mode.

The current implementation masks the value using mcounteren (and
hcounteren in VS-mode), which incorrectly restricts visibility in M-mode.

This patch updates scountovf_csr_t::read() so that counteren masking
is applied only when the current privilege mode is not M-mode.

@aswaterman
Copy link
Copy Markdown
Collaborator

Sounds right to me. Please fix the merge conflict, then force-push over the PR.

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.

2 participants