aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@evo.osdl.org>2005-07-22 18:19:20 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-07-22 18:19:20 -0400
commit2847e3478c3d8119eedc3e0cb85a308b21f681dd (patch)
tree40e24b6a405331ae5fc9ed38b0d4872c84069891
parent38afd6adf6bccd7176e88c07cac104d3639aa30d (diff)
x86: use alternative instructions for fnsave/fxsave too
This one ends up using an inline asm format that claims to read memory and then clobber it (rather than just write it directly), which made it easier to use the existing "alternative_input()" infrastructure support. Now the fxsave code matches the fxrstor.
-rw-r--r--include/asm-i386/i387.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h
index e678609bb57..6747006743f 100644
--- a/include/asm-i386/i387.h
+++ b/include/asm-i386/i387.h
@@ -33,7 +33,7 @@ extern void init_fpu(struct task_struct *);
"nop ; frstor %1", \
"fxrstor %1", \
X86_FEATURE_FXSR, \
- "m" ((tsk)->thread.i387.fsave))
+ "m" ((tsk)->thread.i387.fxsave))
extern void kernel_fpu_begin(void);
#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0)
@@ -43,13 +43,12 @@ extern void kernel_fpu_begin(void);
*/
static inline void __save_init_fpu( struct task_struct *tsk )
{
- if ( cpu_has_fxsr ) {
- asm volatile( "fxsave %0 ; fnclex"
- : "=m" (tsk->thread.i387.fxsave) );
- } else {
- asm volatile( "fnsave %0 ; fwait"
- : "=m" (tsk->thread.i387.fsave) );
- }
+ alternative_input(
+ "fnsave %1 ; fwait ;" GENERIC_NOP2,
+ "fxsave %1 ; fnclex",
+ X86_FEATURE_FXSR,
+ "m" (tsk->thread.i387.fxsave)
+ :"memory");
tsk->thread_info->status &= ~TS_USEDFPU;
}