linux-user, fix: Preserve x87 state in signal frames - #423
Open
ganjue66da wants to merge 1 commit into
Open
Conversation
The 32-bit signal path invoked destructive FSAVE before building the FXSAVE or XSAVE image. FSAVE initializes the x87 state, so sigreturn restored an empty stack instead of the interrupted state for Minke.MI. Organ CLR suspension. Capture the extended state before filling the legacy FSAVE area. This preserves both signal-frame formats while leaving the initialized x87 state for the handler, matching Linux x86 signal semantics. Tests: - Verify that an x87 value survives SIGUSR1 delivery and sigreturn Signed-off-by: Wenqiang Wei <weiwenqiang@mail.ustc.edu.cn>
ganjue66da
force-pushed
the
codex/x87-signal-frame
branch
from
August 25, 2026 03:54
8e172d2 to
159c645
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
An x87 value could be lost or restored into the wrong logical stack slot after a guest signal because the i386 signal frame did not preserve the complete x87 state used by LATX.
Changes
linux-user/i386/signal.c.Validation
ninja -C build32 latx-i386LATX_SOFTFPU=2 build32/latx-i386 latx-x87-signal-stack-test-onesignals=1 failures=0.Scope
This PR contains one correctness fix. LBT TOP cleanup is submitted separately.