x86/fpu: Add fpu_state_config::legacy_features
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Oct 2021 22:55:09 +0000 (15:55 -0700)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Oct 2021 08:18:09 +0000 (10:18 +0200)
commitc33f0a81a2cf3920465309ce683534751bb86485
treebc4f3638b7a069ff3bc7072f3d9207ee101253b5
parent6f6a7c09c4065a5b140194dfcfe4cf7104fec4d2
x86/fpu: Add fpu_state_config::legacy_features

The upcoming prctl() which is required to request the permission for a
dynamically enabled feature will also provide an option to retrieve the
supported features. If the CPU does not support XSAVE, the supported
features would be 0 even when the CPU supports FP and SSE.

Provide separate storage for the legacy feature set to avoid that and fill
in the bits in the legacy init function.

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-6-chang.seok.bae@intel.com
arch/x86/include/asm/fpu/types.h
arch/x86/kernel/fpu/init.c