[PATCH] um: always use the internal copy of the FP registers
Benjamin Berg
benjamin at sipsolutions.net
Fri Sep 13 01:42:50 PDT 2024
On Fri, 2024-09-13 at 10:22 +0200, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg at intel.com>
>
> 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 at intel.com>
Hi,
I did test this mcontext restore and ptrace register setting both on
i386 and x86_64 using the attached program.
Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-signal-restore.c
Type: text/x-csrc
Size: 3902 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-um/attachments/20240913/cf4696c9/attachment.bin>
More information about the linux-um
mailing list