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

Trap Handler Issue in S Mode with Virtualization Enabled #394

Closed
Ammar-10xe opened this issue Oct 3, 2023 · 3 comments
Closed

Trap Handler Issue in S Mode with Virtualization Enabled #394

Ammar-10xe opened this issue Oct 3, 2023 · 3 comments

Comments

@Ammar-10xe
Copy link

Issue Description

There's an issue related to the behavior of the trap_handler when handling exceptions in S mode with virtualization enabled.The issue manifests itself in two distinct scenarios:

  1. Scenario 1: When handling exceptions in S mode with the mdeleg specific bit set for a particular exception, and virtualization is turned off, the trap_handler functions correctly.

  2. Scenario 2: The problem arises when an exception occurs during virtualization enabeled, and the mdeleg specific bit is set to a high value.

Expected Behavior:
The expected behavior is that the trap_handler should consistently handle exceptions in S mode, regardless of whether virtualization is enabled or not. In Scenario 2, where virtualization is active, the trap_handler should continue to function correctly even when the mdeleg specific bit is set to a high value.

Current Behavior:
However, the current behavior of the trap_handler does not align with this expectation. It results in an inconsistency in how exceptions are managed between Scenario 1 and Scenario 2.

@allenjbaum
Copy link
Collaborator

We have been working on this one for a while. 
This is related to issue #374
A fix is in progress; just reviewing it now.
When we get a PR ready to go, I'll ask you test it out.
But... there are currently no support in Sail for the H-extension yet, so: how are you testing this?
There is a requirement if you are running your own tests: defining RVTEST_VTRAP_ROUTINE to enable the VS mode trap handler.

@UmerShahidengr
Copy link
Collaborator

@allenjbaum , @Ammarkhan561 is working with me on checking trap handler in S-mode (in bare mode and in virtual mode).
We have identified a few potential bugs related to the save area, sp register value updates, and behaviour of scratch register in virtual mode. I am in the middle of typing an email to you explaining the whole situation.
So far, we haven't enabled HS mode, this issue is logged to track the potential bugs in trap handler in S-mode only.

@UmerShahidengr
Copy link
Collaborator

This issue has been resolved by PR #401

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