Skip to content

Commit d72c870

Browse files
KAGA-KOKOsuryasaimadhu
authored andcommitted
x86/fpu/xstate: Move remaining xfeature helpers to core
Now that everything is mopped up, move all the helpers and prototypes into the core header. They are not required by the outside. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent eda32f4 commit d72c870

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

arch/x86/include/asm/fpu/xstate.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,6 @@
8686
#define XFEATURE_MASK_FPSTATE (XFEATURE_MASK_USER_RESTORE | \
8787
XFEATURE_MASK_SUPERVISOR_SUPPORTED)
8888

89-
static inline u64 xfeatures_mask_supervisor(void)
90-
{
91-
return fpu_kernel_cfg.max_features & XFEATURE_MASK_SUPERVISOR_SUPPORTED;
92-
}
93-
94-
static inline u64 xfeatures_mask_independent(void)
95-
{
96-
if (!boot_cpu_has(X86_FEATURE_ARCH_LBR))
97-
return XFEATURE_MASK_INDEPENDENT & ~XFEATURE_MASK_LBR;
98-
99-
return XFEATURE_MASK_INDEPENDENT;
100-
}
101-
10289
extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
10390

10491
extern void __init update_regset_xstate_info(unsigned int size,

arch/x86/kernel/fpu/xstate.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ extern void fpu__init_system_xstate(unsigned int legacy_size);
3535

3636
extern void *get_xsave_addr(struct xregs_state *xsave, int xfeature_nr);
3737

38+
static inline u64 xfeatures_mask_supervisor(void)
39+
{
40+
return fpu_kernel_cfg.max_features & XFEATURE_MASK_SUPERVISOR_SUPPORTED;
41+
}
42+
43+
static inline u64 xfeatures_mask_independent(void)
44+
{
45+
if (!cpu_feature_enabled(X86_FEATURE_ARCH_LBR))
46+
return XFEATURE_MASK_INDEPENDENT & ~XFEATURE_MASK_LBR;
47+
48+
return XFEATURE_MASK_INDEPENDENT;
49+
}
50+
3851
/* XSAVE/XRSTOR wrapper functions */
3952

4053
#ifdef CONFIG_X86_64

0 commit comments

Comments
 (0)