x86/fpu: Add a pkru argument to copy_uabi_from_kernel_to_xstate().
authorKyle Huey <me@kylehuey.com>
Tue, 15 Nov 2022 23:09:28 +0000 (15:09 -0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 16 Nov 2022 23:03:01 +0000 (15:03 -0800)
commit1c813ce0305571e1b2e4cc4acca451da9e6ad18f
treea6e37a28cdb97054118ba1b864c2d24d5a1e5212
parent6a877d2450ace4f27c012519e5a1ae818f931983
x86/fpu: Add a pkru argument to copy_uabi_from_kernel_to_xstate().

Both KVM (through KVM_SET_XSTATE) and ptrace (through PTRACE_SETREGSET
with NT_X86_XSTATE) ultimately call copy_uabi_from_kernel_to_xstate(),
but the canonical locations for the current PKRU value for KVM guests
and processes in a ptrace stop are different (in the kvm_vcpu_arch and
the thread_state structs respectively).

In preparation for eventually handling PKRU in
copy_uabi_to_xstate, pass in a pointer to the PKRU location.

Signed-off-by: Kyle Huey <me@kylehuey.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20221115230932.7126-3-khuey%40kylehuey.com
arch/x86/kernel/fpu/core.c
arch/x86/kernel/fpu/regset.c
arch/x86/kernel/fpu/xstate.c
arch/x86/kernel/fpu/xstate.h