OSDN Git Service

x86/fpu: Add XFD handling for dynamic states
authorChang S. Bae <chang.seok.bae@intel.com>
Thu, 21 Oct 2021 22:55:26 +0000 (15:55 -0700)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Oct 2021 08:53:03 +0000 (10:53 +0200)
commitdb3e7321b4b84b1cb39598ff79b90d1252481378
tree99dcb5fd5aeb7d5562aba88069d9fdd14d989b28
parent2ae996e0c1a38ca57a52438ab9deec6761dcba62
x86/fpu: Add XFD handling for dynamic states

To handle the dynamic sizing of buffers on first use the XFD MSR has to be
armed. Store the delta between the maximum available and the default
feature bits in init_fpstate where it can be retrieved for task creation.

If the delta is non zero then dynamic features are enabled. This needs also
to enable the static key which guards the XFD updates. This is delayed to
an initcall because the FPU setup runs before jump labels are initialized.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20211021225527.10184-23-chang.seok.bae@intel.com
arch/x86/kernel/fpu/xstate.c