diff options
-rw-r--r-- | arch/x86/include/asm/i387.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 8002e9ce25fc..c991b3a7b904 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/hardirq.h> | 18 | #include <linux/hardirq.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <asm/asm.h> | 20 | #include <asm/asm.h> |
21 | #include <asm/cpufeature.h> | ||
21 | #include <asm/processor.h> | 22 | #include <asm/processor.h> |
22 | #include <asm/sigcontext.h> | 23 | #include <asm/sigcontext.h> |
23 | #include <asm/user.h> | 24 | #include <asm/user.h> |
@@ -57,16 +58,9 @@ extern int restore_i387_xstate_ia32(void __user *buf); | |||
57 | 58 | ||
58 | #define X87_FSW_ES (1 << 7) /* Exception Summary */ | 59 | #define X87_FSW_ES (1 << 7) /* Exception Summary */ |
59 | 60 | ||
60 | static inline bool use_xsave(void) | 61 | static __always_inline __pure bool use_xsave(void) |
61 | { | 62 | { |
62 | u8 has_xsave; | 63 | return static_cpu_has(X86_FEATURE_XSAVE); |
63 | |||
64 | alternative_io("mov $0, %0", | ||
65 | "mov $1, %0", | ||
66 | X86_FEATURE_XSAVE, | ||
67 | "=qm" (has_xsave)); | ||
68 | |||
69 | return has_xsave; | ||
70 | } | 64 | } |
71 | 65 | ||
72 | #ifdef CONFIG_X86_64 | 66 | #ifdef CONFIG_X86_64 |