Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misa WLRL field #537

Closed
pdonahue-ventana opened this issue Jul 10, 2020 · 4 comments · Fixed by #615
Closed

misa WLRL field #537

pdonahue-ventana opened this issue Jul 10, 2020 · 4 comments · Fixed by #615

Comments

@pdonahue-ventana
Copy link
Contributor

"The misa CSR is a WARL read-write register" seems not entirely true since it contains a WLRL field.

Also, the definition of WLRL says that such fields must only be written with legal values (a software requirement) and that the reset value of WLRL fields must be legal (a hardware requirement). The software requirement can be complied with by always doing read-modify-write. But the hardware requirement can only be complied with if legal values are specified. Unlike the other WLRL fields in the privileged spec, there is no description of what values are legal for this misa field. We can infer that zero is one of the legal values since the whole register is allowed to be zero, but that doesn't rule out other legal values.

Is this field implementation-specific and UNSPECIFIED? Must it be zero (as was the case when the field was WIRI two years ago)? Something else?

@aswaterman
Copy link
Member

It is true that forward-compatible software shouldn't try to write fields it doesn't know about to nonzero values, because newer versions of the spec could assign meaning to such fields. But I don't think it means the unused bits are actually WLRL. Writing them to a nonzero value on future hardware could cause behavior that software doesn't expect, because it could enable some extension that software doesn't know about. But that's different from causing UNSPECIFIED behavior.

The unused misa bits are analogous to pmpcfg bits 6:5, which are currently always 0, but which might take on new meaning in the future. We label those pmpcfg bits as "0 (WARL)". I think we should be doing the same thing for the unused misa bits.

@allenjbaum
Copy link

allenjbaum commented Jul 11, 2020 via email

@aswaterman
Copy link
Member

@allenjbaum I guess I'm saying I think this is an editing oversight, and they should indeed be marked WARL (0).

@allenjbaum
Copy link

allenjbaum commented Jul 11, 2020 via email

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 a pull request may close this issue.

3 participants