diff options
author | Brian Gerst <brgerst@gmail.com> | 2010-09-03 21:17:10 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-09-09 17:16:25 -0400 |
commit | 51115d4d45700fc7c08306f7ba6e68551f526ae5 (patch) | |
tree | 7bc7321d8840089519df3892a3187b53a9ba3bb2 /arch/x86/include/asm/i387.h | |
parent | 6ac8bac2684235f4caf22a410549c582aa7327d6 (diff) |
x86, fpu: Merge tolerant_fwait()
Commit e2e75c91 merged the math exception handler, allowing both 32-bit
and 64-bit to handle math exceptions from kernel mode. Switch to using
the 64-bit version of tolerant_fwait() without fnclex, which simply
ignores the exception if one is still pending from userspace.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <1283563039-3466-4-git-send-email-brgerst@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm/i387.h')
-rw-r--r-- | arch/x86/include/asm/i387.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index a73a8d5a5e69..5d8f9a79fa5d 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -77,15 +77,6 @@ static inline void sanitize_i387_state(struct task_struct *tsk) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | #ifdef CONFIG_X86_64 | 79 | #ifdef CONFIG_X86_64 |
80 | |||
81 | /* Ignore delayed exceptions from user space */ | ||
82 | static inline void tolerant_fwait(void) | ||
83 | { | ||
84 | asm volatile("1: fwait\n" | ||
85 | "2:\n" | ||
86 | _ASM_EXTABLE(1b, 2b)); | ||
87 | } | ||
88 | |||
89 | static inline int fxrstor_checking(struct i387_fxsave_struct *fx) | 80 | static inline int fxrstor_checking(struct i387_fxsave_struct *fx) |
90 | { | 81 | { |
91 | int err; | 82 | int err; |
@@ -220,11 +211,6 @@ extern void finit_soft_fpu(struct i387_soft_struct *soft); | |||
220 | static inline void finit_soft_fpu(struct i387_soft_struct *soft) {} | 211 | static inline void finit_soft_fpu(struct i387_soft_struct *soft) {} |
221 | #endif | 212 | #endif |
222 | 213 | ||
223 | static inline void tolerant_fwait(void) | ||
224 | { | ||
225 | asm volatile("fnclex ; fwait"); | ||
226 | } | ||
227 | |||
228 | /* perform fxrstor iff the processor has extended states, otherwise frstor */ | 214 | /* perform fxrstor iff the processor has extended states, otherwise frstor */ |
229 | static inline int fxrstor_checking(struct i387_fxsave_struct *fx) | 215 | static inline int fxrstor_checking(struct i387_fxsave_struct *fx) |
230 | { | 216 | { |
@@ -344,7 +330,10 @@ static inline void __unlazy_fpu(struct task_struct *tsk) | |||
344 | static inline void __clear_fpu(struct task_struct *tsk) | 330 | static inline void __clear_fpu(struct task_struct *tsk) |
345 | { | 331 | { |
346 | if (task_thread_info(tsk)->status & TS_USEDFPU) { | 332 | if (task_thread_info(tsk)->status & TS_USEDFPU) { |
347 | tolerant_fwait(); | 333 | /* Ignore delayed exceptions from user space */ |
334 | asm volatile("1: fwait\n" | ||
335 | "2:\n" | ||
336 | _ASM_EXTABLE(1b, 2b)); | ||
348 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | 337 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
349 | stts(); | 338 | stts(); |
350 | } | 339 | } |