-
Notifications
You must be signed in to change notification settings - Fork 23
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
Extensions state save and restore #36
Comments
Be careful that those save/restore action should be ISA/configuration dependent. |
I see some work has been done on this upstream - at least from a first glance https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=dbcbc858c71f69da76d1f36d6bb5d72f2db11eda looks like it may potentially help/solve this issue once a future rebase occurs? |
@pascalgouedo, the commit mentioned by @simonpcook is now in our codebase, and is in the latest toolchain release. Does this address the issue for you? Can we close this issue? |
Hi @Mary |
Hi This finally causes deadlock because returning address from an interrupt (MEPC) has not been saved at the beginning of the save phase and is lost because of its override by the illegal instruction detection. So this MSTATUS.FS value check should be added to all the checks described above. |
Signed-off-by: Pascal Gouedo <[email protected]>
AP: Is there an upstream bug? |
When using corev-openhw-gcc-centos7-20230331 toolchain with F extensions, all interrupt handlers blindly save and restore f registers without looking at Floating-Point state in MSTATUS register.
Moreover it does not save/restore full state as FCSR is missing.
In RISC-V Privilege specification, Machine Status Register (mstatus) section shows some fields for extension states:
and SD to summarize the dirtiness of all those 3 extensions.
When SD equals 1, this means that any of those 3 extensions has been used since they have been enabled or since the last context restore.
So FS/XS/VS should be tested to understand which extension is "Dirty" and needs whole state save and restore when changing the execution context (interrupt route, context switch, etc,...).
When SD is 0, no state needs to be saved/restored and interrupt latency/context switch/... is improved because 33 registers write in memory (generally stack) are not done. Same for the state restore at the end of the interrupt routine/context switch/...
A full description of the FS/XS/VS state transitions is described in Table 3.4
The text was updated successfully, but these errors were encountered: