diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2023-04-02 16:25:52 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2023-04-06 21:19:58 +0300 |
commit | 00df1fc0601e9710df05e306e20402baed3b341a (patch) | |
tree | 9bc22efdce98b60db6ea6d634f68ce5581741757 | |
parent | 4e00c63897b8c1956d53cb38249a047d5386aadf (diff) | |
download | serenity-00df1fc0601e9710df05e306e20402baed3b341a.zip |
Kernel: Store FPU state when dispatching signal on aarch64
And make sure to also restore it in sys$sigreturn.
-rw-r--r-- | Kernel/Syscalls/sigaction.cpp | 2 | ||||
-rw-r--r-- | Kernel/Thread.cpp | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/Kernel/Syscalls/sigaction.cpp b/Kernel/Syscalls/sigaction.cpp index 7071b92978..cd17407109 100644 --- a/Kernel/Syscalls/sigaction.cpp +++ b/Kernel/Syscalls/sigaction.cpp @@ -87,14 +87,12 @@ ErrorOr<FlatPtr> Process::sys$sigreturn(RegisterState& registers) // Stack state (created by the signal trampoline): // saved_ax, ucontext, signal_info, fpu_state?. -#if ARCH(X86_64) // The FPU state is at the top here, pop it off and restore it. // FIXME: The stack alignment is off by 8 bytes here, figure this out and remove this excessively aligned object. alignas(alignof(FPUState) * 2) FPUState data {}; TRY(copy_from_user(&data, bit_cast<FPUState const*>(stack_ptr))); Thread::current()->fpu_state() = data; stack_ptr += sizeof(FPUState); -#endif stack_ptr += sizeof(siginfo); // We don't need this here. diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 38fde59613..e464028f43 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -1150,10 +1150,8 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal) VERIFY(stack % 16 == 0); -#if ARCH(X86_64) // Save the FPU/SSE state TRY(copy_value_on_user_stack(stack, fpu_state())); -#endif TRY(push_value_on_user_stack(stack, pointer_to_ucontext)); TRY(push_value_on_user_stack(stack, pointer_to_signal_info)); |