-
Notifications
You must be signed in to change notification settings - Fork 41
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
SSE and FPU support #410
SSE and FPU support #410
Conversation
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.
This goes into the right direction, thanks for the work! I marked some desired changes inline.
Addressed the review comments. |
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.
Thanks for updating the PR! I left a couple of review comments.
Addressed review comments. |
Rebase done. |
What are the rules for FP/SSE in interrupt handlers? Is the interrupt dispatch logic required to save/restore FPU state to prevent reentrant corruption? |
None of this is handled yet in this PR. The plan is that the kernel is in general not allowed to use the FPU at all. There will be calls to enable/disable FPU usage, that would save/restore the state, but will not be possible to be used in a nested way. This means that IRQ handlers are in general not allowed to use the FPU. |
Some cpuid functions require a non-zero value of xcr0 to be passed. Signed-off-by: Vasant Karasulli <[email protected]>
Check for the available SSE/FPU related features and initialize them. Signed-off-by: Vasant Karasulli <[email protected]>
Reserve xsave area for tasks to manage xstate. Signed-off-by: Vasant Karasulli <[email protected]>
use xsaveopt/xrstor instructions to save and restore task context. Signed-off-by: Vasant Karasulli <[email protected]>
These in-svsm tests check if tasks can use some sse/fpu instructions and xstate is saved/restored properly during task switches. Signed-off-by: Vasant Karasulli <[email protected]>
This is a temporary solution until we have smart pointer. This also gives a chance to move xsave/xrestor functionality outside the assembly block. Signed-off-by: Vasant Karasulli <[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.
The changes look ready for merging to me. There are still a few rough edges, but some of them need a better kernel initialization infrastructure first. So lets move on with this now. Thanks for taking on and driving this work forward, @vsntk18
This PR entails following changes:
I will submit the related exception handling in another PR.