x86/fpu: Add XFD state to fpstate
authorChang S. Bae <chang.seok.bae@intel.com>
Thu, 21 Oct 2021 22:55:18 +0000 (15:55 -0700)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Oct 2021 08:18:09 +0000 (10:18 +0200)
commit8bf26758ca9659866b844dd51037314b4c0fa6bd
tree4c702e253c9112ab848855451484aef3a9148ad0
parentdae1bd58389615d401a84aedc38fa075ef8f7de6
x86/fpu: Add XFD state to fpstate

Add storage for XFD register state to struct fpstate. This will be used to
store the XFD MSR state. This will be used for switching the XFD MSR when
FPU content is restored.

Add a per-CPU variable to cache the current MSR value so the MSR has only
to be written when the values are different.

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