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

MCAUSE/MTVAL for illegal SCR addresses #34

Open
kliuMsft opened this issue Feb 1, 2024 · 2 comments
Open

MCAUSE/MTVAL for illegal SCR addresses #34

kliuMsft opened this issue Feb 1, 2024 · 2 comments

Comments

@kliuMsft
Copy link
Contributor

kliuMsft commented Feb 1, 2024

When r/w an unimplemented SCR address (e.g., 22), Looks like sail is trapping with MCAUSE = 2 and MTVAL=0. Just want to confirm that's indeed the intention (in the case of PERM_SR violation it returns MCAUSE = 0x1c).

@rmn30
Copy link
Collaborator

rmn30 commented Feb 19, 2024

Yes, the former is a reserved instruction exception (as with a non-existent CSR) and we gave the latter its own CHERI cause with mtval indicating cause = 0x18 reg = PCC. Arguably it would be more RISC-V like to use reserved instruction there as with accessing CSR in the wrong mode.

@marnovandermaas
Copy link
Contributor

Can this issue be closed now or is there an outstanding action here?

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

No branches or pull requests

3 participants