1126fe040SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0 */ 2126fe040SThomas Gleixner #ifndef __X86_KERNEL_FPU_XSTATE_H 3126fe040SThomas Gleixner #define __X86_KERNEL_FPU_XSTATE_H 4126fe040SThomas Gleixner 5126fe040SThomas Gleixner #include <asm/cpufeature.h> 6126fe040SThomas Gleixner #include <asm/fpu/xstate.h> 7126fe040SThomas Gleixner 8126fe040SThomas Gleixner static inline void xstate_init_xcomp_bv(struct xregs_state *xsave, u64 mask) 9126fe040SThomas Gleixner { 10126fe040SThomas Gleixner /* 11126fe040SThomas Gleixner * XRSTORS requires these bits set in xcomp_bv, or it will 12126fe040SThomas Gleixner * trigger #GP: 13126fe040SThomas Gleixner */ 14126fe040SThomas Gleixner if (cpu_feature_enabled(X86_FEATURE_XSAVES)) 15126fe040SThomas Gleixner xsave->header.xcomp_bv = mask | XCOMP_BV_COMPACTED_FORMAT; 16126fe040SThomas Gleixner } 17126fe040SThomas Gleixner 18*ca834defSThomas Gleixner extern void __copy_xstate_to_uabi_buf(struct membuf to, struct xregs_state *xsave, 19*ca834defSThomas Gleixner u32 pkru_val, enum xstate_copy_mode copy_mode); 20*ca834defSThomas Gleixner 21126fe040SThomas Gleixner #endif 22