x86/fpu: Split the state handling in fpu__drop()
authorIngo Molnar <[email protected]>
Sat, 23 Sep 2017 13:00:00 +0000 (15:00 +0200)
committerIngo Molnar <[email protected]>
Sun, 24 Sep 2017 11:04:34 +0000 (13:04 +0200)
commitb6aa85558d7e7b18fc3470d2bc1731d2205dd275
tree36f8fdcaa749ba225152a88e946fe9e5c19d7683
parenta10b6a16cdad88170f546d008c77453cddf918e6
x86/fpu: Split the state handling in fpu__drop()

Prepare fpu__drop() to use fpu->fpregs_active.

There are two distinct usecases for fpu__drop() in this context:
exit_thread() when called for 'current' in exit(), and when called
for another task in fork().

This patch does not change behavior, it only adds a couple of
debug checks and structures the code to make the ->fpregs_active
change more obviously correct.

All the complications will be removed later on.

Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Yu-cheng Yu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/fpu/core.c