xstate.h (d72c87018d00782c3ac0a844c372158087debc0a) xstate.h (23686ef25d4ae81bc12fe3994d1905191fcf71f8)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_X86_XSAVE_H
3#define __ASM_X86_XSAVE_H
4
5#include <linux/uaccess.h>
6#include <linux/types.h>
7
8#include <asm/processor.h>

--- 29 unchanged lines hidden (view full) ---

38/*
39 * Features which are restored when returning to user space.
40 * PKRU is not restored on return to user space because PKRU
41 * is switched eagerly in switch_to() and flush_thread()
42 */
43#define XFEATURE_MASK_USER_RESTORE \
44 (XFEATURE_MASK_USER_SUPPORTED & ~XFEATURE_MASK_PKRU)
45
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_X86_XSAVE_H
3#define __ASM_X86_XSAVE_H
4
5#include <linux/uaccess.h>
6#include <linux/types.h>
7
8#include <asm/processor.h>

--- 29 unchanged lines hidden (view full) ---

38/*
39 * Features which are restored when returning to user space.
40 * PKRU is not restored on return to user space because PKRU
41 * is switched eagerly in switch_to() and flush_thread()
42 */
43#define XFEATURE_MASK_USER_RESTORE \
44 (XFEATURE_MASK_USER_SUPPORTED & ~XFEATURE_MASK_PKRU)
45
46/* Features which are dynamically enabled for a process on request */
47#define XFEATURE_MASK_USER_DYNAMIC 0ULL
48
46/* All currently supported supervisor features */
47#define XFEATURE_MASK_SUPERVISOR_SUPPORTED (XFEATURE_MASK_PASID)
48
49/*
50 * A supervisor state component may not always contain valuable information,
51 * and its size may be huge. Saving/restoring such supervisor state components
52 * at each context switch can cause high CPU and space overhead, which should
53 * be avoided. Such supervisor state components should only be saved/restored

--- 37 unchanged lines hidden (view full) ---

91extern void __init update_regset_xstate_info(unsigned int size,
92 u64 xstate_mask);
93
94int xfeature_size(int xfeature_nr);
95
96void xsaves(struct xregs_state *xsave, u64 mask);
97void xrstors(struct xregs_state *xsave, u64 mask);
98
49/* All currently supported supervisor features */
50#define XFEATURE_MASK_SUPERVISOR_SUPPORTED (XFEATURE_MASK_PASID)
51
52/*
53 * A supervisor state component may not always contain valuable information,
54 * and its size may be huge. Saving/restoring such supervisor state components
55 * at each context switch can cause high CPU and space overhead, which should
56 * be avoided. Such supervisor state components should only be saved/restored

--- 37 unchanged lines hidden (view full) ---

94extern void __init update_regset_xstate_info(unsigned int size,
95 u64 xstate_mask);
96
97int xfeature_size(int xfeature_nr);
98
99void xsaves(struct xregs_state *xsave, u64 mask);
100void xrstors(struct xregs_state *xsave, u64 mask);
101
102#ifdef CONFIG_X86_64
103DECLARE_STATIC_KEY_FALSE(__fpu_state_size_dynamic);
99#endif
104#endif
105
106#ifdef CONFIG_X86_64
107DECLARE_STATIC_KEY_FALSE(__fpu_state_size_dynamic);
108
109static __always_inline __pure bool fpu_state_size_dynamic(void)
110{
111 return static_branch_unlikely(&__fpu_state_size_dynamic);
112}
113#else
114static __always_inline __pure bool fpu_state_size_dynamic(void)
115{
116 return false;
117}
118#endif
119
120#endif