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

Load/store exception handler: handle re-entry via a NMI. #644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ourairquality
Copy link
Contributor

The NMI can asynchronously interrupt the load/store exception handler. This does occur frequently as the NMI handler code does invoke load/store exceptions, and the load/store exception handler is heavily used. This was corrupting the load/store exception handler saved state and thus randomly corrupting registers a0 to a6 of the interruptee.

Re-entry of the load/store handler was quite frequent so this one needs fixing. Testing or review feedback would be welcomed? This PR implements a different strategy to the SDK fix and might be more efficient and supports multiple re-entry via an NMI.

The sdk code also appears to handle NMI re-entry too, but that seems a separate issue. Not yet sure where that is a problem, perhaps very quick repetition of an NMI before the handler disables it, or perhaps on the exit path after re-enabling the NMI but before restoring state from the NMI stack? Shall look into that separately.

The NMI can asynchronously interrupt the load/store exception handler. This
does occur frequently as the NMI handler code does invoke load/store
exceptions, and the load/store exception handler is heavly used. This was
corrupting the load/store exception handler saved state and thus randomly
corrupting registers a0 to a6 of the interruptee.
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.

None yet

1 participant