x86/fpu: Configure init_fpstate attributes orderly
authorChang S. Bae <chang.seok.bae@intel.com>
Wed, 24 Aug 2022 19:12:21 +0000 (12:12 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 17 Oct 2022 13:44:25 +0000 (15:44 +0200)
commitc32d7cab57e3a77af8ecc17cde7a5761a26483b8
tree3189952b13c1839623d1e4ec3eb0139ff12c0e3e
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
x86/fpu: Configure init_fpstate attributes orderly

The init_fpstate setup code is spread out and out of order. The init image
is recorded before its scoped features and the buffer size are determined.

Determine the scope of init_fpstate components and its size before
recording the init state. Also move the relevant code together.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: neelnatu@google.com
Link: https://lore.kernel.org/r/20220824191223.1248-2-chang.seok.bae@intel.com
arch/x86/kernel/fpu/init.c
arch/x86/kernel/fpu/xstate.c