-
Notifications
You must be signed in to change notification settings - Fork 110
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
Env filter trap fault #39
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Deepak Gupta <[email protected]>
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 <[email protected]>
handle_trap will call trap_filter. Tests can implement trap_filter to take necessary actions. Signed-off-by: Deepak Gupta <[email protected]>
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 <[email protected]>
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 <[email protected]>
@aswaterman That change is anyways seems like can be used by tests for other arch extensions. |
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 <[email protected]>
This PR adds following
FILTER_TRAP
macro and allow certain traps to go back to test cases.FILTER_PAGE_FAULT
macro and allow certain page faults to go back to test cases.[1] - https://github.com/riscv/riscv-cfi