Skip to content

fix: preserve SSE state in x86_64 bthread context switch - #21

Open
Spicy-cream wants to merge 2 commits into
LinQuickDev:masterfrom
Spicy-cream:fix_clang
Open

fix: preserve SSE state in x86_64 bthread context switch#21
Spicy-cream wants to merge 2 commits into
LinQuickDev:masterfrom
Spicy-cream:fix_clang

Conversation

@Spicy-cream

Copy link
Copy Markdown

Related to apache#2781.

Summary

Preserve XMM6-XMM15 during Linux x86_64 bthread context switches and update the initial context frame created by
bthread_make_fcontext accordingly.

Changes

  • Save and restore XMM6-XMM15.
  • Expand the x86_64 context frame.
  • Update the MXCSR and x87 control-word offsets.
  • Keep bthread_make_fcontext consistent with the new frame layout.
  • Use unaligned SIMD moves for context storage.

Verification

Validated in the affected x86_64 environment. The streaming_echo_c++ example runs normally and the crash reported in
apache#2781 no longer occurs.

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.

1 participant