]> www.infradead.org Git - users/jedix/linux-maple.git/commit
um: always use the internal copy of the FP registers
authorBenjamin Berg <benjamin.berg@intel.com>
Fri, 13 Sep 2024 13:38:45 +0000 (15:38 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Oct 2024 10:03:55 +0000 (12:03 +0200)
commit5a6951273e0e9dc0f79facf22281a8a731fb90b1
treee8b65704dc743bcfd211950bd7015f7972b745a4
parent865e3845eeaa21e9a62abc1361644e67124f1ec0
um: always use the internal copy of the FP registers

When switching from userspace to the kernel, all registers including the
FP registers are copied into the kernel and restored later on. As such,
the true source for the FP register state is actually already in the
kernel and they should never be grabbed from the userspace process.

Change the various places to simply copy the data from the internal FP
register storage area. Note that on i386 the format of PTRACE_GETFPREGS
and PTRACE_GETFPXREGS is different enough that conversion would be
needed. With this patch, -EINVAL is returned if the non-native format is
requested.

The upside is, that this patchset fixes setting registers via ptrace
(which simply did not work before) as well as fixing setting floating
point registers using the mcontext on signal return on i386.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240913133845.964292-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/include/shared/registers.h
arch/um/kernel/process.c
arch/x86/um/os-Linux/registers.c
arch/x86/um/ptrace_32.c
arch/x86/um/ptrace_64.c
arch/x86/um/signal.c