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

Use stval/stval2 for HS-mode exceptions, not htval/htval2 #483

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

jrtc27
Copy link
Collaborator

@jrtc27 jrtc27 commented Dec 12, 2024

htval exists solely to communiate extra information to HS-mode about VS-mode faults to HS-mode, currently just the guest physical address for G-stage page faults. CHERI exceptions can and must (to align with other kinds of faults, including HS-mode's own faults) use stval/stval2 when trapping from HS-mode.

Fixes #482

htval exists solely to communiate extra information to HS-mode about
VS-mode faults to HS-mode, currently just the guest physical address for
G-stage page faults. CHERI exceptions can and must (to align with other
kinds of faults, including HS-mode's own faults) use stval/stval2 when
trapping from HS-mode.

Fixes riscv#482
@chrehrhardt
Copy link

The last sentence of the commit message should probably read "...when trapping to HS-mode". Otherwise LGTM.

@jrtc27
Copy link
Collaborator Author

jrtc27 commented Dec 16, 2024

The last sentence of the commit message should probably read "...when trapping to HS-mode". Otherwise LGTM.

The text I deleted talked of exceptions "taken in HS-mode", which to me means "from HS-mode". But I agree that, on rereading, it probably meant to say "to HS-mode", because otherwise M-mode could be handling them and then using htval(2) makes even less sense.

@tariqkurd-repo tariqkurd-repo merged commit a7ab1b2 into riscv:main Dec 17, 2024
3 checks passed
@jrtc27 jrtc27 deleted the htval branch December 17, 2024 12:03
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.

Use of htval(2) for CHERI faults is odd
3 participants