Skip to content

Commit 00df1fc

Browse files
FireFox317IdanHo
authored andcommitted
Kernel: Store FPU state when dispatching signal on aarch64
And make sure to also restore it in sys$sigreturn.
1 parent 4e00c63 commit 00df1fc

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

Kernel/Syscalls/sigaction.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,12 @@ ErrorOr<FlatPtr> Process::sys$sigreturn(RegisterState& registers)
8787
// Stack state (created by the signal trampoline):
8888
// saved_ax, ucontext, signal_info, fpu_state?.
8989

90-
#if ARCH(X86_64)
9190
// The FPU state is at the top here, pop it off and restore it.
9291
// FIXME: The stack alignment is off by 8 bytes here, figure this out and remove this excessively aligned object.
9392
alignas(alignof(FPUState) * 2) FPUState data {};
9493
TRY(copy_from_user(&data, bit_cast<FPUState const*>(stack_ptr)));
9594
Thread::current()->fpu_state() = data;
9695
stack_ptr += sizeof(FPUState);
97-
#endif
9896

9997
stack_ptr += sizeof(siginfo); // We don't need this here.
10098

Kernel/Thread.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,10 +1150,8 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
11501150

11511151
VERIFY(stack % 16 == 0);
11521152

1153-
#if ARCH(X86_64)
11541153
// Save the FPU/SSE state
11551154
TRY(copy_value_on_user_stack(stack, fpu_state()));
1156-
#endif
11571155

11581156
TRY(push_value_on_user_stack(stack, pointer_to_ucontext));
11591157
TRY(push_value_on_user_stack(stack, pointer_to_signal_info));

0 commit comments

Comments
 (0)