All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 00/41] x86/fpu: Spring cleaning and PKRU sanitizing
@ 2021-06-11 16:15 Thomas Gleixner
  2021-06-11 16:15 ` [patch 01/41] Revert a5eff7259790 ("x86/pkeys: Add PKRU value to init_fpstate") Thomas Gleixner
                   ` (41 more replies)
  0 siblings, 42 replies; 69+ messages in thread
From: Thomas Gleixner @ 2021-06-11 16:15 UTC (permalink / raw)
  To: LKML
  Cc: Andy Lutomirski, Dave Hansen, Fenghua Yu, Tony Luck, Yu-cheng Yu,
	Sebastian Andrzej Siewior, Borislav Petkov, Peter Zijlstra,
	Kan Liang

This is a follow up to these patch series:

 - [patch V2 00/14] x86/fpu: Mop up XSAVES and related damage
   https://lore.kernel.org/r/20210605234742.712464974@linutronix.de

 - [PATCH 00/18] x86/pkeys: stop managing PKRU with XSAVE
   https://lore.kernel.org/r/20210603230803.31660AFE@viggo.jf.intel.com

 - [PATCH 0/2] x86/fpu: Clean up "dynamic" APIs
   https://lore.kernel.org/r/cover.1623388344.git.luto@kernel.org

The analysis of the subtle bugs in the FPU code triggered a larger
discussion about the general state of this code. The above patch series are
all related to this and the following series combines them into one because
the already started consolidation work and the PKRU rework collided all
over the place.

The main parts of this series are:

  - Simplification and removal/replacement of redundant and/or
    overengineered code.

  - Name space cleanup as the existing names were just a permanent source
    of confusion.

  - Clear seperation of user ABI and kernel internal state handling.

  - Removal of PKRU from being XSTATE managed in the kernel because PKRU
    has to be eagerly restored on context switch and keeping it in sync
    in the xstate buffer is just pointless overhead and fragile.

    The kernel still XSAVEs PKRU on context switch but the value in the
    buffer is not longer used and never restored from the buffer.

    This still needs to be cleaned up, but the series is already 40+
    patches large and the cleanup of this is not a functional problem.

    The functional issues of PKRU management are fully addressed with the
    series as is.

It applies on top of

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master

and is also available via git:

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

Thanks,

	tglx
---
 arch/x86/events/intel/lbr.c          |    6 
 arch/x86/include/asm/fpu/internal.h  |  155 ++++-------
 arch/x86/include/asm/fpu/xstate.h    |   61 +++-
 arch/x86/include/asm/pgtable.h       |   57 ----
 arch/x86/include/asm/pkeys.h         |    9 
 arch/x86/include/asm/processor.h     |    9 
 arch/x86/include/asm/special_insns.h |   14 -
 arch/x86/kernel/cpu/common.c         |   29 --
 arch/x86/kernel/fpu/core.c           |  243 ++++++++++++------
 arch/x86/kernel/fpu/init.c           |    4 
 arch/x86/kernel/fpu/regset.c         |  116 ++++----
 arch/x86/kernel/fpu/signal.c         |   59 ++--
 arch/x86/kernel/fpu/xstate.c         |  456 +++++++++++------------------------
 arch/x86/kernel/process.c            |   19 +
 arch/x86/kernel/process_64.c         |   28 ++
 arch/x86/kvm/svm/sev.c               |    1 
 arch/x86/kvm/x86.c                   |   52 ++-
 arch/x86/mm/extable.c                |    2 
 arch/x86/mm/fault.c                  |    2 
 arch/x86/mm/pkeys.c                  |   22 -
 b/arch/x86/include/asm/pkru.h        |   62 ++++
 include/linux/pkeys.h                |    4 
 22 files changed, 671 insertions(+), 739 deletions(-)




^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2021-06-17  7:06 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 16:15 [patch 00/41] x86/fpu: Spring cleaning and PKRU sanitizing Thomas Gleixner
2021-06-11 16:15 ` [patch 01/41] Revert a5eff7259790 ("x86/pkeys: Add PKRU value to init_fpstate") Thomas Gleixner
2021-06-11 17:04   ` Borislav Petkov
2021-06-11 16:15 ` [patch 02/41] x86/fpu: Mark various FPU states __ro_after_init Thomas Gleixner
2021-06-11 17:21   ` Borislav Petkov
2021-06-11 18:35   ` Andy Lutomirski
2021-06-11 16:15 ` [patch 03/41] x86/fpu: Remove unused get_xsave_field_ptr() Thomas Gleixner
2021-06-11 18:35   ` Andy Lutomirski
2021-06-11 16:15 ` [patch 04/41] x86/fpu: Move inlines where they belong Thomas Gleixner
2021-06-11 16:15 ` [patch 05/41] x86/fpu: Limit xstate copy size in xstateregs_set() Thomas Gleixner
2021-06-11 18:15   ` Borislav Petkov
2021-06-11 18:37   ` Andy Lutomirski
2021-06-11 19:37     ` Thomas Gleixner
2021-06-11 16:15 ` [patch 06/41] x86/fpu: Sanitize xstateregs_set() Thomas Gleixner
2021-06-11 18:45   ` Andy Lutomirski
2021-06-11 20:23     ` Thomas Gleixner
2021-06-11 16:15 ` [patch 07/41] x86/fpu: Simplify PTRACE_GETREGS code Thomas Gleixner
2021-06-11 18:47   ` Andy Lutomirski
2021-06-12  9:13   ` Borislav Petkov
2021-06-11 16:15 ` [patch 08/41] x86/fpu: Restrict fpstate sanitizing to legacy components Thomas Gleixner
2021-06-11 19:03   ` Andy Lutomirski
2021-06-11 19:18     ` Andy Lutomirski
2021-06-11 20:33       ` Thomas Gleixner
2021-06-11 20:34         ` Thomas Gleixner
2021-06-11 20:27     ` Thomas Gleixner
2021-06-11 22:12     ` Thomas Gleixner
2021-06-12 13:15       ` Thomas Gleixner
2021-06-12 22:05       ` Thomas Gleixner
2021-06-11 16:15 ` [patch 09/41] x86/kvm: Avoid looking up PKRU in XSAVE buffer Thomas Gleixner
2021-06-14 10:26   ` Borislav Petkov
2021-06-14 19:34     ` Dave Hansen
2021-06-15 10:09       ` Borislav Petkov
2021-06-11 16:15 ` [patch 10/41] x86/fpu: Cleanup arch_set_user_pkey_access() Thomas Gleixner
2021-06-11 16:15 ` [patch 11/41] x86/fpu: Get rid of copy_supervisor_to_kernel() Thomas Gleixner
2021-06-11 19:42   ` Andy Lutomirski
2021-06-11 16:15 ` [patch 12/41] x86/fpu: Rename copy_xregs_to_kernel() and copy_kernel_to_xregs() Thomas Gleixner
2021-06-11 16:15 ` [patch 13/41] x86/fpu: Rename copy_user_to_xregs() and copy_xregs_to_user() Thomas Gleixner
2021-06-11 16:15 ` [patch 14/41] x86/fpu: Rename fxregs related copy functions Thomas Gleixner
2021-06-11 16:15 ` [patch 15/41] x86/fpu: Rename fregs " Thomas Gleixner
2021-06-11 16:15 ` [patch 16/41] x86/fpu: Rename xstate copy functions which are related to UABI Thomas Gleixner
2021-06-11 16:15 ` [patch 17/41] x86/fpu: Deduplicate copy_uabi_from_user/kernel_to_xstate() Thomas Gleixner
2021-06-11 16:15 ` [patch 18/41] x86/fpu: Rename copy_fpregs_to_fpstate() to save_fpregs_to_fpstate() Thomas Gleixner
2021-06-11 16:15 ` [patch 19/41] x86/fpu: Rename copy_kernel_to_fpregs() to restore_fpregs_from_kernel() Thomas Gleixner
2021-06-11 16:15 ` [patch 20/41] x86/fpu: Rename initstate copy functions Thomas Gleixner
2021-06-11 16:15 ` [patch 21/41] x86/fpu: Rename "dynamic" XSTATEs to "independent" Thomas Gleixner
2021-06-11 16:15 ` [patch 22/41] x86/fpu/xstate: Sanitize handling of independent features Thomas Gleixner
2021-06-11 16:15 ` [patch 23/41] x86/pkeys: Move read_pkru() and write_pkru() Thomas Gleixner
2021-06-11 16:15 ` [patch 24/41] x86/fpu: Differentiate "copy" versus "move" of fpregs Thomas Gleixner
2021-06-11 16:15 ` [patch 25/41] x86/cpu: Sanitize X86_FEATURE_OSPKE Thomas Gleixner
2021-06-11 16:15 ` [patch 26/41] x86/pkru: Provide pkru_get_init_value() Thomas Gleixner
2021-06-11 16:15 ` [patch 27/41] x86/pkru: Provide pkru_write_default() Thomas Gleixner
2021-06-11 16:15 ` [patch 28/41] x86/cpu: Write the default PKRU value when enabling PKE Thomas Gleixner
2021-06-11 16:15 ` [patch 29/41] x86/fpu: Use pkru_write_default() in copy_init_fpstate_to_fpregs() Thomas Gleixner
2021-06-11 16:15 ` [patch 30/41] x86/fpu: Rename fpu__clear_all() to fpu_flush_thread() Thomas Gleixner
2021-06-11 16:15 ` [patch 31/41] x86/fpu: Clean up the fpu__clear() variants Thomas Gleixner
2021-06-11 16:15 ` [patch 32/41] x86/fpu: Rename __fpregs_load_activate() to fpregs_restore_userregs() Thomas Gleixner
2021-06-11 16:15 ` [patch 33/41] x86/fpu: Move FXSAVE_LEAK quirk info __copy_kernel_to_fpregs() Thomas Gleixner
2021-06-11 16:15 ` [patch 34/41] x86/fpu: Rename xfeatures_mask_user() to xfeatures_mask_uabi() Thomas Gleixner
2021-06-11 16:15 ` [patch 35/41] x86/fpu: Dont restore PKRU in fpregs_restore_userspace() Thomas Gleixner
2021-06-11 16:15 ` [patch 36/41] x86/fpu: Add PKRU storage outside of task XSAVE buffer Thomas Gleixner
2021-06-11 16:16 ` [patch 37/41] x86/fpu: Hook up PKRU into ptrace() Thomas Gleixner
2021-06-11 16:16 ` [patch 38/41] x86/fpu: Mask PKRU from kernel XRSTOR[S] operations Thomas Gleixner
2021-06-11 16:16 ` [patch 39/41] x86/fpu: Remove PKRU handling from switch_fpu_finish() Thomas Gleixner
2021-06-11 16:16 ` [patch 40/41] x86/fpu: Dont store PKRU in xstate in fpu_reset_fpstate() Thomas Gleixner
2021-06-11 16:16 ` [patch 41/41] x86/pkru: Remove xstate fiddling from write_pkru() Thomas Gleixner
2021-06-12  0:24 ` [patch 00/41] x86/fpu: Spring cleaning and PKRU sanitizing Thomas Gleixner
2021-06-12  0:40   ` Dave Hansen
2021-06-16 20:55   ` Dave Hansen
2021-06-17  7:06     ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.