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

Add changes in arch_test.h file, split macros into 2 files and enable multiple Privilege Modes in Trap Handler #277

Merged
merged 22 commits into from
Jan 25, 2023

Conversation

UmerShahidengr
Copy link
Collaborator

This PR is co-authored-by: allenjbaum [email protected], and modification of PR-267.
As requested by @pawks, the trap handler and macro definitions have been split into two different files, arch_test.h contains definitions of trap handler, macros to change privilege modes, and other necessary macros while macros to manage storing signatures, and ops dependent general macros are defined in test_macros.h file.
The major changes with respect to PR-267 are as follows:

  • Removed the bugs in RVTEST_GOTO_LOWER_MODE macro
  • Removed the bugs in RVTEST_GOTO_MMODE macro and defined strap_routine directive.
  • Updated RVTEST_TRAP_SAVEAREA and RVTEST_TRAP_EPILOG macros to refine the definitions of per mode save area macros.

@UmerShahidengr UmerShahidengr changed the title Updated arch_test.h file Add changes in arch_test.h file, split macros into 2 files and enable multiple Privilege Modes in Trap Handler Aug 14, 2022
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
@UmerShahidengr
Copy link
Collaborator Author

Hello @pawks, @allenjbaum and I have updated the trap handler, and now it is working perfectly. Please review and merge it

Copy link
Contributor

@InspireSemi InspireSemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In test_macros.h
The #warnings have been commented out. Either we uncomment these or just remove the this whole section from the file. Lines 768 - 818.
These macros have been deprecated and now is as good a time as any to remove them.

@allenjbaum
Copy link
Collaborator

allenjbaum commented Sep 20, 2022 via email

@InspireSemi
Copy link
Contributor

InspireSemi commented Sep 20, 2022 via email

@allenjbaum
Copy link
Collaborator

allenjbaum commented Sep 20, 2022 via email

@UmerShahidengr
Copy link
Collaborator Author

Hello,
As sent by @allenjbaum , this final commit is ready to be merged. Allen found and fixed a bunch of bugs related to:

  • code paths I haven't exercised that have vectored interrupt modes
  • better indications of when the trap signature area is overrun
  • ensuring that the trap handler keeps the trampoline 64B aligned (need for CLIC spec)
  • fixing the handling of when xTVEC was not initialized and also could not be written
  • removing code that was compensating for Sail bugs
  • rewriting the save_GPR macro to it now compiles
  • some miscellaneous optimizations
  • comment fixes

@neelgala
Copy link
Collaborator

A changelog entry is required. Please make this a "minor" update and in the Changelog be as detailed as possible in terms of the changes and feature additions that this PR introduces.

@UmerShahidengr
Copy link
Collaborator Author

A changelog entry is required. Please make this a "minor" update and in the Changelog be as detailed as possible in terms of the changes and feature additions that this PR introduces.

Done.

@pawks
Copy link
Collaborator

pawks commented Nov 10, 2022

There are some merge conflicts between the arch_test.h files on the main and the PR. Please pull the recent changes from main and resolve the conflicts correctly.

@UmerShahidengr
Copy link
Collaborator Author

There are some merge conflicts between the arch_test.h files on the main and the PR. Please pull the recent changes from main and resolve the conflicts correctly.

Done!

@pawks
Copy link
Collaborator

pawks commented Nov 10, 2022

The changes on the master are being overwritten. Especially the canary definitions here.

…ifferently in tests and defined differently in latest trap handler
@UmerShahidengr
Copy link
Collaborator Author

The changes on the master are being overwritten. Especially the canary definitions here.

The CANARY error has been resolved. Now all (90) tests of RV32 are passing with the updated definition of CANARY.

riscv-test-suite/env/arch_test.h Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
riscv-test-suite/env/test_macros.h Outdated Show resolved Hide resolved
riscv-test-suite/env/test_macros.h Outdated Show resolved Hide resolved
riscv-test-suite/env/test_macros.h Outdated Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
riscv-test-suite/env/arch_test.h Outdated Show resolved Hide resolved
@UmerShahidengr
Copy link
Collaborator Author

Added changes proposed in #294 into this PR.

@UmerShahidengr
Copy link
Collaborator Author

Were you able to run the tests under rv64i_m/C directory? With the latest changes, all C extension tests fail to compile. This is probably because of a .option norvc in the template macros which is not clubbed with a .option push ... .option pop sequence. An instance of the error is shown below:

Error: unrecognized opcode `c.addi16sp x2,0x100'

The tests were passing at my side, but before commit, I made one random change in LI macro (I swapped the places of .option pull and .endif in LI macro) which caused this problem for all C type tests. The file has been refreshed and all C type tests are now passing

@allenjbaum
Copy link
Collaborator

allenjbaum commented Dec 23, 2022 via email

@allenjbaum
Copy link
Collaborator

allenjbaum commented Dec 23, 2022 via email

Copy link
Collaborator

@allenjbaum allenjbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are numerous problems with this fix. There are some fixes, also, but this isn't ready for prime time.

Copy link
Collaborator

@pawks pawks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes look good to me. The current tests pass. LGTM

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.

6 participants