x86/fpu/xstate: Separate user and supervisor xfeatures mask
Before the introduction of XSAVES supervisor states, 'xfeatures_mask' is used at various places to determine XSAVE buffer components and XCR0 bits. It contains only user xstates. To support supervisor xstates, it is necessary to separate user and supervisor xstates: - First, change 'xfeatures_mask' to 'xfeatures_mask_all', which represents the full set of bits that should ever be set in a kernel XSAVE buffer. - Introduce xfeatures_mask_supervisor() and xfeatures_mask_user() to extract relevant xfeatures from xfeatures_mask_all. Co-developed-by:Fenghua Yu <fenghua.yu@intel.com> Signed-off-by:
Fenghua Yu <fenghua.yu@intel.com> 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> Reviewed-by:
Tony Luck <tony.luck@intel.com> Link: https://lkml.kernel.org/r/20200512145444.15483-4-yu-cheng.yu@intel.com
Showing
- arch/x86/include/asm/fpu/internal.h 1 addition, 1 deletionarch/x86/include/asm/fpu/internal.h
- arch/x86/include/asm/fpu/xstate.h 12 additions, 1 deletionarch/x86/include/asm/fpu/xstate.h
- arch/x86/kernel/fpu/signal.c 11 additions, 5 deletionsarch/x86/kernel/fpu/signal.c
- arch/x86/kernel/fpu/xstate.c 43 additions, 30 deletionsarch/x86/kernel/fpu/xstate.c
Loading
Please register or sign in to comment