-
Notifications
You must be signed in to change notification settings - Fork 217
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
Conversation
4d78fe3
to
da638ba
Compare
Hello @pawks, @allenjbaum and I have updated the trap handler, and now it is working perfectly. Please review and merge it |
There was a problem hiding this 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.
I'm unclear what has been deprecated; do you mean that #warning has been
deprecated in the toolchain?
…On Tue, Sep 20, 2022 at 7:12 AM InspireSemi ***@***.***> wrote:
***@***.**** requested changes on this pull request.
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.
—
Reply to this email directly, view it on GitHub
<#277 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJUCZERQXXUX5DVEU3DV7HA4RANCNFSM56PYCGHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The macros in this section of the header are marked as being deprecated.
Someone commented out the #warning messages that say this macro is deprecated since 3.0….
So either uncomment the #warning messages and leave the macros in place or remove the whole block of macros.
Marc Karasek
Principal Software Engineer
M: 678.770.3788
***@***.***
www.inspiresemi.com<http://www.cryptocoretech.com/>
THIS MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND/OR EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If the reader of this message is not the intended recipient or agent responsible for delivering the message to the intended recipient, then you are hereby notified that any dissemination or copying of this communication is strictly prohibited. If you have received this electronic transmission in error, please delete it from your system without copying it and notify the sender by reply e-mail so that our address record can be corrected. Thank you.
From: Allen Baum ***@***.***>
Sent: Tuesday, September 20, 2022 2:23 PM
To: riscv-non-isa/riscv-arch-test ***@***.***>
Cc: Marc Karasek ***@***.***>; Comment ***@***.***>
Subject: Re: [riscv-non-isa/riscv-arch-test] Add changes in arch_test.h file, split macros into 2 files and enable multiple Privilege Modes in Trap Handler (PR #277)
I'm unclear what has been deprecated; do you mean that #warning has been
deprecated in the toolchain?
On Tue, Sep 20, 2022 at 7:12 AM InspireSemi ***@***.***<mailto:***@***.***>> wrote:
***@***.****<mailto:***@***.****> requested changes on this pull request.
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.
—
Reply to this email directly, view it on GitHub
<#277 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJUCZERQXXUX5DVEU3DV7HA4RANCNFSM56PYCGHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***<mailto:***@***.***>>
—
Reply to this email directly, view it on GitHub<#277 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AR3S6YZ5ZUGV7NHPMDXHBW3V7H6IVANCNFSM56PYCGHQ>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Ah, those macros. I thought you meant some other macros that use #warning
Yes, I think we can remove line 768 to the end of the file at line 818
|
Hello,
|
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. |
There are some merge conflicts between the |
Done! |
The changes on the master are being overwritten. Especially the canary definitions here. |
…ifferently in tests and defined differently in latest trap handler
The CANARY error has been resolved. Now all (90) tests of RV32 are passing with the updated definition of CANARY. |
Added changes proposed in #294 into this PR. |
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 |
…ifferent address mappings
Signed-off-by: Umer Shahid <[email protected]>
… from outside code region + SET_REL_TVAL_MSK & CODE_REL_TVAL_MSK has been updated + some minor fixes
An overflow?Not sure what that means. The code above (or below, I guess)
is not the correct fix.
All Instances of SREG or FSREG, offset+SIGALIGN(_BR)
should be changed to FSREG, offset(_BR)
because the CHK_OFFSET(_BR,SIGALIGN,1) pre-increment the offset.
…On Thu, Dec 22, 2022 at 9:17 PM S Pawan Kumar ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In riscv-test-suite/env/test_macros.h
<#277 (comment)>
:
> +/* It stores both an Xreg and an Freg, first adjusting base & offset to */
+/* to keep offset < 2048. SIGALIGN is set to the max(FREGWIDTH, REGWIDTH)*/
+/* _BR - Base Reg, _R - FReg, _F - Fstatus Xreg */
+#define RVTEST_SIGUPD_F(_BR,_R,_F,...) ;\
+ .if NARG(__VA_ARGS__) == 1 ;\
+ .set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
+ .endif ;\
+ .if (offset&(SIGALIGN-1))!=0 ;\
+/* Throw warnings then modify offset to target */ ;\
+ .warning "Incorrect signature Offset Alignment." ;\
+ .set offset, offset&(SIGALIGN-1)+SIGALIGN ;\
+ .endif ;\
+ CHK_OFFSET(_BR, SIGALIGN, 0) ;\
+ FSREG _R,offset(_BR) ;\
+ CHK_OFFSET(_BR, SIGALIGN, 1) ;\
+ SREG _F,offset+SIGALIGN(_BR) ;\
The latest macros on the main have been fixed(link
<https://github.com/riscv-non-isa/riscv-arch-test/blob/e302d3bab41a46ec388691b1d961aa09fe2a4bc4/riscv-test-suite/env/arch_test.h#L661>).
By introducing the offset+SIGALIGN the tests do not compile because an
overflow occurs after a few instances of the macro in the test,
specifically at line 106. In its current form, it also results in the flag
values of preceding test instance getting overwritten by the result of the
next instance.
—
Reply to this email directly, view it on GitHub
<#277 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJRNWILXUQCILOPA3FDWOUYV5ANCNFSM56PYCGHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
More correctly, in case this is misinterpreted:
All Instances of SREG/FSREG, offset+SIGALIGN(_BR)
should be changed to SREG/FSREG, offset(_BR)
On Fri, Dec 23, 2022 at 12:14 AM Allen Baum ***@***.***>
wrote:
… An overflow?Not sure what that means. The code above (or below, I guess)
is not the correct fix.
All Instances of SREG or FSREG, offset+SIGALIGN(_BR)
should be changed to FSREG, offset(_BR)
because the CHK_OFFSET(_BR,SIGALIGN,1) pre-increment the offset.
On Thu, Dec 22, 2022 at 9:17 PM S Pawan Kumar ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In riscv-test-suite/env/test_macros.h
> <#277 (comment)>
> :
>
> > +/* It stores both an Xreg and an Freg, first adjusting base & offset to */
> +/* to keep offset < 2048. SIGALIGN is set to the max(FREGWIDTH, REGWIDTH)*/
> +/* _BR - Base Reg, _R - FReg, _F - Fstatus Xreg */
> +#define RVTEST_SIGUPD_F(_BR,_R,_F,...) ;\
> + .if NARG(__VA_ARGS__) == 1 ;\
> + .set offset,_ARG1(__VA_OPT__(__VA_ARGS__,0)) ;\
> + .endif ;\
> + .if (offset&(SIGALIGN-1))!=0 ;\
> +/* Throw warnings then modify offset to target */ ;\
> + .warning "Incorrect signature Offset Alignment." ;\
> + .set offset, offset&(SIGALIGN-1)+SIGALIGN ;\
> + .endif ;\
> + CHK_OFFSET(_BR, SIGALIGN, 0) ;\
> + FSREG _R,offset(_BR) ;\
> + CHK_OFFSET(_BR, SIGALIGN, 1) ;\
> + SREG _F,offset+SIGALIGN(_BR) ;\
>
> The latest macros on the main have been fixed(link
> <https://github.com/riscv-non-isa/riscv-arch-test/blob/e302d3bab41a46ec388691b1d961aa09fe2a4bc4/riscv-test-suite/env/arch_test.h#L661>).
> By introducing the offset+SIGALIGN the tests do not compile because an
> overflow occurs after a few instances of the macro in the test,
> specifically at line 106. In its current form, it also results in the flag
> values of preceding test instance getting overwritten by the result of the
> next instance.
>
> —
> Reply to this email directly, view it on GitHub
> <#277 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHPXVJRNWILXUQCILOPA3FDWOUYV5ANCNFSM56PYCGHQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
…ted in CHK_OFFSET
Signed-off-by: S Pawan Kumar <[email protected]>
There was a problem hiding this 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.
There was a problem hiding this 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
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: