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

mtrap_sigptr issue #399

Closed
UmerShahidengr opened this issue Oct 12, 2023 · 2 comments
Closed

mtrap_sigptr issue #399

UmerShahidengr opened this issue Oct 12, 2023 · 2 comments

Comments

@UmerShahidengr
Copy link
Collaborator

While testing the trap handler in delegated trap (within S-mode), a bug is found in handling mtrap_sigptr.
Trap Handler is managing mtrap_sigptr while saving its physical address in Mmode save area, but when trap handler works in S-mode with virtualization enabled, then physical address of mtrap_sigptr will be translated to virtual address, and that virtual address is needed to be stored in Smode save area.
It will originate a new issue in handling the offset between physical address of mtrap_sigptr and virtual address of mtrap_sigptr. Trap handler has to keep the track of offset value (i.e, the data stored in signature after every trap occurrence), and keep updating the physical and virtual addresses of mtrap_sigptr value in Mmode and Smode (and in Vmode in future) save area respectively.

@allenjbaum
Copy link
Collaborator

What I thought was happening was that Smode (or VS mode) accesses the physical address of mtrap_sigptr (which is the only one that is used) and pre-increments it, It then should relocate it to Smode/VSmode address by adding
SSig_Begin-MSigBegin, and uses that to do the actual signature updates. So it is never stored in the Smode save area, it is always translated on the fly.

@UmerShahidengr
Copy link
Collaborator Author

The issue has been resolved by the PR #401 , so closing it.

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

2 participants