Skip to content

Preserve guest floating-point and extended CPU state on Windows - #1340

Merged
Weiteng Chen (CvvT) merged 6 commits into
mainfrom
weiteng/windows_save_fp_state
Sep 12, 2026
Merged

Preserve guest floating-point and extended CPU state on Windows#1340
Weiteng Chen (CvvT) merged 6 commits into
mainfrom
weiteng/windows_save_fp_state

Conversation

@CvvT

Copy link
Copy Markdown
Contributor

Preserve guest floating-point and SIMD state across syscalls, exceptions, and host interrupts, while ensuring host Rust code runs with Windows ABI floating-point controls.

  • For syscall that does not update rip, save guest state with XSAVE and restore it with XRSTOR on the fast resume path.
  • For exception and interrupt, preserve extended state through Windows context capture and NtContinue.
  • For syscall that updates rip, save guest state with XSAVE but restore it with NtContinue.

@CvvT
Weiteng Chen (CvvT) marked this pull request as ready for review September 10, 2026 00:30
Comment thread litebox_platform_windows_userland/src/lib.rs
@wdcui

Copy link
Copy Markdown
Member

Sangho Lee (@sangho2) can you help review this PR? Thanks!

@sangho2

Copy link
Copy Markdown
Contributor

Do we need to worry about the below? perhaps out of this PR's scope (AArch64 Linux variant somehow handles it).

@sangho2 Sangho Lee (sangho2) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall, looks good to me. We might want to use XSAVEC or XAVEOPT later, but better to have a correct implementation first.

Comment thread litebox_platform_windows_userland/src/lib.rs
@CvvT

Copy link
Copy Markdown
Contributor Author

Do we need to worry about the below? perhaps out of this PR's scope (AArch64 Linux variant somehow handles it).

Yes, we should, but probably after I also fix Linux userland platform.

@CvvT
Weiteng Chen (CvvT) force-pushed the weiteng/windows_save_fp_state branch from d90f306 to 597c787 Compare September 11, 2026 19:03
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@CvvT
Weiteng Chen (CvvT) added this pull request to the merge queue Sep 12, 2026
Merged via the queue into main with commit f6d2510 Sep 12, 2026
15 checks passed
@CvvT
Weiteng Chen (CvvT) deleted the weiteng/windows_save_fp_state branch September 12, 2026 22:26
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.

3 participants