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

clarify mtval2/stval2/vstval2 handling #518

Merged
merged 7 commits into from
Feb 6, 2025

Conversation

tariqkurd-repo
Copy link
Collaborator

they need to be updated on all exceptions, not just CHERI ones

@tariqkurd-repo tariqkurd-repo changed the title clarify stval2/vstval2 updating clarify mtval2/stval2/vstval2 updating Feb 4, 2025
@tariqkurd-repo tariqkurd-repo marked this pull request as draft February 4, 2025 15:06
@arichardson
Copy link
Collaborator

Just to clarify that I understand the intent here: You are requiring it to be written to zero for non-CHERI traps?

Is that actually needed, or can we just keep a stale value here for a non-CHERI fault?

@jrtc27
Copy link
Collaborator

jrtc27 commented Feb 4, 2025

H has:

When a guest-page-fault trap is taken into HS-mode, htval is written with either zero or the guest
physical address that faulted, shifted right by 2 bits. For other traps, htval is set to zero, but a
future standard or extension may redefine htval’s setting for other traps.

When a guest-page-fault trap is taken into M-mode, mtval2 is written with either zero or the guest
physical address that faulted, shifted right by 2 bits. For other traps, mtval2 is set to zero, but a
future standard or extension may redefine mtval2’s setting for other traps.

The point is that, by writing 0 now, you can detect non-zero values should it ever start to be used for another existing trap.

@tariqkurd-repo tariqkurd-repo changed the title clarify mtval2/stval2/vstval2 updating clarify mtval2/stval2/vstval2 handling Feb 5, 2025
Copy link
Contributor

@chrehrhardt chrehrhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two instances where vstval should be vstval2. Otherwise LGTM.

fix CSR names

Signed-off-by: Tariq Kurd <tariqandlaura@gmail.com>
better description of the table

Signed-off-by: Tariq Kurd <tariqandlaura@gmail.com>
@tariqkurd-repo tariqkurd-repo marked this pull request as ready for review February 5, 2025 12:58
whitespace

Signed-off-by: Tariq Kurd <tariqandlaura@gmail.com>
@tariqkurd-repo tariqkurd-repo merged commit af30f1c into riscv:main Feb 6, 2025
3 checks passed
tariqkurd-repo added a commit to tariqkurd-repo/riscv-cheri that referenced this pull request Feb 10, 2025
they need to be updated on all exceptions, not just CHERI ones

---------

Signed-off-by: Tariq Kurd <tariqandlaura@gmail.com>
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.

4 participants