arch/x86_64: fix kernel build issues found with LTP - #19791
Merged
xiaoxiang781216 merged 3 commits intoAug 11, 2026
Conversation
SYS_signal_handler_return restored RSP from saved_rsp, which is not written when a task signals itself: synchronous dispatch skips up_schedule_sigaction(), so the kernel stack pointer was set to zero and the next push faulted. Save the kernel stack pointer at dispatch in xcp.kstkptr, as risc-v does, and restore that. Signed-off-by: raiden00pl <raiden00@railab.me> Assisted-by: Claude Code
For a thread interrupted in user mode the trampoline ran on the user stack, where the signal handler then grows over its frame. Run it on the thread kernel stack, unused while the thread is in user mode. The stack cannot be selected from the saved CS: up_initial_state() records the caller CS, a kernel selector even for user threads. Signed-off-by: raiden00pl <raiden00@railab.me> Assisted-by: Claude Code
The signal frame was built inside the 128 byte red zone of the interrupted user code and inherited its stack alignment, so a leaf function could lose live data to the siginfo copy and the handler could fault on an SSE access. Build the frame below the red zone, 16 byte aligned; the naked trampoline calls the handler itself and its call provides the return address slot. Signed-off-by: raiden00pl <raiden00@railab.me> Assisted-by: Claude Code
xiaoxiang781216
approved these changes
Aug 11, 2026
acassis
approved these changes
Aug 11, 2026
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.
Summary
Impact
intel64 kernel build fixes
Testing
intel64 qemu in kernel build with LTP.
LTP tests without and with these commits: