x86/fpu: Move register state into a container struct (part 2)
Status from this message: The following commit has been merged into the x86/fpu branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/21 | x86/fpu: Provide struct fpstatearch/ arch/ arch/ +2 more | +39 | 0 replies | |
| 2/21 | x86/fpu: Convert fpstate_init() to struct fpstatearch/ arch/ arch/ +1 more | +31 | 0 replies | |
| 3/21 | x86/fpu: Convert restore_fpregs_from_fpstate() to struct fpstatearch/ arch/ arch/ | +8 | 0 replies | |
| 4/21 | x86/fpu: Replace KVMs xstate component clearingarch/ arch/ arch/ +2 more | +19 | 0 replies | |
| 5/21 | x86/KVM: Convert to fpstatearch/ | +2 | 1 reply | |
| 6/21 | x86/fpu: Convert tracing to fpstatearch/ | +2 | 0 replies | |
| 7/21 | x86/fpu/regset: Convert to fpstatearch/ | +14 | 0 replies | |
| 8/21 | x86/fpu/signal: Convert to fpstatearch/ | +16 | 0 replies | |
| 9/21 | x86/fpu/core: Convert to fpstatearch/ arch/ arch/ +1 more | +27 | 0 replies | |
| 10/21 | x86/math-emu: Convert to fpstatearch/ arch/ arch/ | +4 | 0 replies | |
| 11/21 | x86/fpu: Remove fpu::statearch/ arch/ | +7 | 0 replies | |
| 12/21 | x86/fpu: Do not leak fpstate pointer on forkarch/ | +2 | 0 replies | |
| 13/21 | x86/process: Move arch_thread_struct_whitelist() out of linearch/ arch/ arch/ | +15 | 0 replies | |
| 14/21 | x86/fpu: Add size and mask information to fpstatearch/ arch/ arch/ +1 more | +30 | 0 replies | |
| 15/21 | x86/fpu: Use fpstate::sizearch/ arch/ | +9 | 0 replies | |
| 16/21 | x86/fpu/xstate: Use fpstate for os_xsave()arch/ arch/ arch/ | +6 | 0 replies | |
| 17/21 | x86/fpu/xstate: Use fpstate for xsave_to_user_sigframe()arch/ | +1 | 0 replies | |
| 18/21 | x86/fpu: Use fpstate in fpu_copy_kvm_uabi_to_fpstate()arch/ | +6 | 0 replies | |
| 19/21 | x86/fpu: Use fpstate in __copy_xstate_to_uabi_buf()arch/ arch/ arch/ | +11 | 0 replies | |
| 20/21 | x86/fpu/xstate: Use fpstate for copy_uabi_to_xstate()arch/ arch/ arch/ +3 more | +26 | 0 replies | |
| 21/21 | x86/fpu/signal: Use fpstate for size and featuresarch/ | +19 | 1 reply |
Reviews trailers per patch
1 of 21 patches has a Reviewed-by or Acked-by.
| Patch | Paolo Bonzini |
|---|---|
| 1/21 | |
| 2/21 | |
| 3/21 | |
| 4/21 | |
| 5/21 | A-b |
| 6/21 | |
| 7/21 | |
| 8/21 | |
| 9/21 | |
| 10/21 | |
| 11/21 | |
| 12/21 | |
| 13/21 | |
| 14/21 | |
| 15/21 | |
| 16/21 | |
| 17/21 | |
| 18/21 | |
| 19/21 | |
| 20/21 | |
| 21/21 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch 00/21] x86/fpu: Move register state into a container struct (part 2)
This is the second part of the effort to support AMX. The first part can be found here:
https://lore.kernel.org/r/[email protected]
With AMX the FPU register state buffer which is part of task_struct::thread::fpu is not going to be extended unconditionally for all tasks on an AMX enabled system as that would waste minimum 8K per task.
AMX provides a mechanism to trap on first use. That trap will be utilized to allocate a larger register state buffer when the task (process) has permissions to use it. The default buffer task_struct will only carry states up to AVX512.
The original approach was to just allocate new register buffer, but that's not the right abstraction.
The current series creates a container which carries information about the fpstate buffer, i.e. feature bits (user and kernel) and sizes (user and kernel).
That allows all relevant code pathes to retrieve the required information from fpstate which avoids conditionals and lets the code just use this instead of reading it from the various global variables which provide this information today.
The series is first introducing the new structure and then converting all usage sites over to it. After that it adds feature and size information and converts the affected code over to use that.
This series is based on:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-1
and also available from git:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-2
The full series with part 3 and 4 on top is available here:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu
Thanks,
tglx
--- include/asm/fpu/api.h | 5 + include/asm/fpu/signal.h | 2 include/asm/fpu/types.h | 42 +++++++++++--- include/asm/fpu/xstate.h | 13 ---- include/asm/processor.h | 9 +-- include/asm/trace/fpu.h | 4 - kernel/fpu/context.h | 2 kernel/fpu/core.c | 140 +++++++++++++++++++++++++++-------------------- kernel/fpu/init.c | 16 ++++- kernel/fpu/internal.h | 7 +- kernel/fpu/regset.c | 28 ++++----- kernel/fpu/signal.c | 70 +++++++++++++---------- kernel/fpu/xstate.c | 56 ++++++++++++------ kernel/fpu/xstate.h | 24 ++++++-- kernel/process.c | 2 kvm/x86.c | 18 ++---- math-emu/fpu_aux.c | 2 math-emu/fpu_entry.c | 4 - math-emu/fpu_system.h | 2 19 files changed, 266 insertions(+), 180 deletions(-)