Skip to content

x86/fpu: Consolidate the size and feature information (part 3)

Thomas Gleixner kvm lkml 1 version Applied

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

  1. v1 Latest8 patches 0 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/8x86/fpu: Provide struct fpu_configarch/x86/include/asm/fpu/types.h arch/x86/kernel/fpu/core.c+43 -00 replies
2/8x86/fpu: Cleanup fpu__init_system_xstate_size_legacy()arch/x86/kernel/fpu/init.c+5 -100 replies
3/8x86/fpu/xstate: Cleanup size calculationsarch/x86/kernel/fpu/xstate.c+46 -360 replies
4/8x86/fpu: Move xstate size to fpu_*_cfgarch/x86/kernel/fpu/core.c arch/x86/kernel/fpu/init.c arch/x86/kernel/fpu/internal.h +4 more+41 -420 replies
5/8x86/fpu: Move xstate feature masks to fpu_*_cfgarch/x86/include/asm/fpu/xstate.h arch/x86/kernel/fpu/core.c arch/x86/kernel/fpu/init.c +2 more+38 -380 replies
6/8x86/fpu: Mop up xfeatures_mask_uabi()arch/x86/include/asm/fpu/xstate.h arch/x86/kernel/fpu/core.c arch/x86/kernel/fpu/signal.c +1 more+6 -150 replies
7/8x86/fpu: Rework restore_regs_from_fpstate()arch/x86/include/asm/fpu/xstate.h arch/x86/kernel/fpu/context.h arch/x86/kernel/fpu/core.c +1 more+23 -290 replies
8/8x86/fpu/xstate: Move remaining xfeature helpers to corearch/x86/include/asm/fpu/xstate.h arch/x86/kernel/fpu/xstate.h+13 -130 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/8] x86/fpu: Consolidate the size and feature information (part 3)

This is the third part of the effort to support AMX. The second 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.

This needs more information than what is provided now with various variables.

The original approach was to just add more variables, but it's simpler to stick this into data structures.

The current series:

- creates a data structure which carries the necessary information:
default and maximum features and sizes.

- instantiates and initializes one for kernel information and one for user space

- converts all users of the old variables

- removes the now unused old variables

It's a straight forward conversion which should not introduce any functional changes.

This series is based on:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-2

and also available from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-3

The full series with part 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/types.h  |   39 ++++++++++
 include/asm/fpu/xstate.h |   47 +-----------
 kernel/fpu/context.h     |    6 -
 kernel/fpu/core.c        |   37 +++++++---
 kernel/fpu/init.c        |   46 +++++-------
 kernel/fpu/internal.h    |    2 
 kernel/fpu/regset.c      |    2 
 kernel/fpu/signal.c      |   11 +-
 kernel/fpu/xstate.c      |  173 +++++++++++++++++++++++++----------------------
 kernel/fpu/xstate.h      |   15 +++-
 10 files changed, 205 insertions(+), 173 deletions(-)