linux/arch/x86/kernel/fpu
Yu-cheng Yu 5d6b6a6f9b x86/fpu/xstate: Update sanitize_restored_xstate() for supervisor xstates
The function sanitize_restored_xstate() sanitizes user xstates of an XSAVE
buffer by clearing bits not in the input 'xfeatures' from the buffer's
header->xfeatures, effectively resetting those features back to the init
state.

When supervisor xstates are introduced, it is necessary to make sure only
user xstates are sanitized.  Ensure supervisor bits in header->xfeatures
stay set and supervisor states are not modified.

To make names clear, also:

- Rename the function to sanitize_restored_user_xstate().
- Rename input parameter 'xfeatures' to 'user_xfeatures'.
- In __fpu__restore_sig(), rename 'xfeatures' to 'user_xfeatures'.

Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lkml.kernel.org/r/20200512145444.15483-7-yu-cheng.yu@intel.com
2020-05-13 20:11:08 +02:00
..
bugs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
core.c x86/fpu/xstate: Define new functions for clearing fpregs and xstates 2020-05-13 13:41:50 +02:00
init.c x86/fpu/xstate: Define new macros for supervisor and user xstates 2020-05-12 20:34:38 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
regset.c x86/fpu/xstate: Rename validate_xstate_header() to validate_user_xstate_header() 2020-05-12 20:20:32 +02:00
signal.c x86/fpu/xstate: Update sanitize_restored_xstate() for supervisor xstates 2020-05-13 20:11:08 +02:00
xstate.c x86/fpu/xstate: Introduce XSAVES supervisor states 2020-05-13 12:16:47 +02:00