diff options
author | Dave Hansen <dave.hansen@linux.intel.com> | 2021-06-23 15:01:38 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-06-23 18:49:46 +0300 |
commit | 3a3351126ee8f1f1c86c4c79c60a650c1da89733 (patch) | |
tree | d62951ad17f6cdd9abd5464e5509dfbc38c77773 /drivers/of | |
parent | 947f4947cf00ea1e6d319eb182c64ea51ba4de8d (diff) | |
download | linux-3a3351126ee8f1f1c86c4c79c60a650c1da89733.tar.xz |
x86/fpu: Simplify PTRACE_GETREGS code
ptrace() has interfaces that let a ptracer inspect a ptracee's register state.
This includes XSAVE state. The ptrace() ABI includes a hardware-format XSAVE
buffer for both the SETREGS and GETREGS interfaces.
In the old days, the kernel buffer and the ptrace() ABI buffer were the
same boring non-compacted format. But, since the advent of supervisor
states and the compacted format, the kernel buffer has diverged from the
format presented in the ABI.
This leads to two paths in the kernel:
1. Effectively a verbatim copy_to_user() which just copies the kernel buffer
out to userspace. This is used when the kernel buffer is kept in the
non-compacted form which means that it shares a format with the ptrace
ABI.
2. A one-state-at-a-time path: copy_xstate_to_kernel(). This is theoretically
slower since it does a bunch of piecemeal copies.
Remove the verbatim copy case. Speed probably does not matter in this path,
and the vast majority of new hardware will use the one-state-at-a-time path
anyway. This ensures greater testing for the "slow" path.
This also makes enabling PKRU in this interface easier since a single path
can be patched instead of two.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121452.408457100@linutronix.de
Diffstat (limited to 'drivers/of')
0 files changed, 0 insertions, 0 deletions