summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/fpu/xstate.h
blob: 81f4202781ac0d9874b0c8496ef6486265e10543 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __X86_KERNEL_FPU_XSTATE_H
#define __X86_KERNEL_FPU_XSTATE_H

#include <asm/cpufeature.h>
#include <asm/fpu/xstate.h>

static inline void xstate_init_xcomp_bv(struct xregs_state *xsave, u64 mask)
{
	/*
	 * XRSTORS requires these bits set in xcomp_bv, or it will
	 * trigger #GP:
	 */
	if (cpu_feature_enabled(X86_FEATURE_XSAVES))
		xsave->header.xcomp_bv = mask | XCOMP_BV_COMPACTED_FORMAT;
}

extern void __copy_xstate_to_uabi_buf(struct membuf to, struct xregs_state *xsave,
				      u32 pkru_val, enum xstate_copy_mode copy_mode);

#endif