Env filter trap fault - #39
Open
deepak0414 wants to merge 6 commits into
Open
Conversation
Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Add support for filtering fault and traps in test cases. Some test cases will need such support (like shadow stack in risc-v cfi) Respective test case can implement the FILTER_TRAP or FILTER_PAGE_FAULT macros. add updates for cfi in encodings.h vm_boot updates mstatus instead of clearing of existing bits. extra_boot might have had set some bits in mstatus earlier. Signed-off-by: Deepak Gupta <debug@rivosinc.com>
handle_trap will call trap_filter. Tests can implement trap_filter to take necessary actions. Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Some of the tests require exception delegated to S mode to be handled. Delegating instruction, access (load/store) exceptions. This patch also adds support for printing which test case failed. Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Member
|
I would like to wait to merge this PR until the CFI extension is closer to being frozen. It seems likely to change in the interim. Also, please remove all of the debugging code that was added. |
adding additional logs for trap filtering mechanism so that failing tests can be debugged. Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Contributor
Author
|
Andrew Waterman (@aswaterman) That change is anyways seems like can be used by tests for other arch extensions. |
Member
|
Seems reasonable; send me a new PR and let’s talk about it there. |
No separate enable/disable bits for back cfi in M/S mode. Software compiled for backward cfi will have anyways back cfi support compiled in. And if it wants to be disabled, it can anyways be disabled via menvcfg and henvcfg. Signed-off-by: Deepak Gupta <debug@rivosinc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds following
FILTER_TRAPmacro and allow certain traps to go back to test cases.FILTER_PAGE_FAULTmacro and allow certain page faults to go back to test cases.[1] - https://github.com/riscv/riscv-cfi