aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/i387.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/i387.h')
-rw-r--r--arch/x86/include/asm/i387.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index c991b3a7b904..bb370fd0a1c2 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -58,11 +58,25 @@ extern int restore_i387_xstate_ia32(void __user *buf);
58 58
59#define X87_FSW_ES (1 << 7) /* Exception Summary */ 59#define X87_FSW_ES (1 << 7) /* Exception Summary */
60 60
61static __always_inline __pure bool use_xsaveopt(void)
62{
63 return 0;
64}
65
61static __always_inline __pure bool use_xsave(void) 66static __always_inline __pure bool use_xsave(void)
62{ 67{
63 return static_cpu_has(X86_FEATURE_XSAVE); 68 return static_cpu_has(X86_FEATURE_XSAVE);
64} 69}
65 70
71extern void __sanitize_i387_state(struct task_struct *);
72
73static inline void sanitize_i387_state(struct task_struct *tsk)
74{
75 if (!use_xsaveopt())
76 return;
77 __sanitize_i387_state(tsk);
78}
79
66#ifdef CONFIG_X86_64 80#ifdef CONFIG_X86_64
67 81
68/* Ignore delayed exceptions from user space */ 82/* Ignore delayed exceptions from user space */