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

arch/risc-v: Fix save/load FPU macros #9123

Merged
merged 1 commit into from Apr 27, 2023

Conversation

pussuw
Copy link
Contributor

@pussuw pussuw commented Apr 27, 2023

Summary

The macros destroy t0, t1, t2 when used, make them explicitly restore them so they are safe to use from where-ever

Impact

Make the save/load FPU macros safe to use from whichever location

Testing

icicle:nsh

The macros destroy t0, t1, t2 when used, make them explicitly restore them
so they are safe to use from where-ever
@pussuw
Copy link
Contributor Author

pussuw commented Apr 27, 2023

This patches something I found out long ago, the save/load macros use t0,t1,t2 as temp registers but do not explicitly restore them. Instead the macros assume they will be restored later (order of execution in riscv_exception_common.S)

@xiaoxiang781216
Copy link
Contributor

@pussuw does your change same as #9103?

@pussuw
Copy link
Contributor Author

pussuw commented Apr 27, 2023

@pussuw does your change same as #9103?

@xiaoxiang781216 No I don't think so. #9103 seems to be related to the floating point status register and saving / restoring the FPU registers.

My patch prevents corrupting the integer registers t0...t2 when using the fpu save/load macros, it does not change how the floating point status register or FPU registers are handled.

@xiaoxiang781216 xiaoxiang781216 merged commit 7184d1f into apache:master Apr 27, 2023
26 checks passed
@pussuw pussuw deleted the riscv_fpu_macros_fix branch April 27, 2023 17:11
@jerpelea jerpelea added this to To-Add in Release Notes - 12.2.0 Jun 13, 2023
@jerpelea jerpelea moved this from To-Add to In Progress in Release Notes - 12.2.0 Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants