diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-14 05:18:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-14 05:18:08 -0400 |
commit | 31677619650cac2bcc9f50920824323b005e3d8a (patch) | |
tree | 9735dbf085ed0cb4a37eb3c285099850e0fb3742 /arch/x86 | |
parent | c2dcfde8274883e1f6050784dcbd34b01e824b91 (diff) | |
parent | 6ffac1e90a17ea0aded5c581204397421eec91b6 (diff) |
Merge branch 'x86/fpu' into x86/urgent
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/signal_64.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/traps_64.c | 9 |
2 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c index b45ef8ddd651..ca316b5b742c 100644 --- a/arch/x86/kernel/signal_64.c +++ b/arch/x86/kernel/signal_64.c | |||
@@ -104,7 +104,16 @@ static inline int restore_i387(struct _fpstate __user *buf) | |||
104 | clts(); | 104 | clts(); |
105 | task_thread_info(current)->status |= TS_USEDFPU; | 105 | task_thread_info(current)->status |= TS_USEDFPU; |
106 | } | 106 | } |
107 | return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); | 107 | err = restore_fpu_checking((__force struct i387_fxsave_struct *)buf); |
108 | if (unlikely(err)) { | ||
109 | /* | ||
110 | * Encountered an error while doing the restore from the | ||
111 | * user buffer, clear the fpu state. | ||
112 | */ | ||
113 | clear_fpu(tsk); | ||
114 | clear_used_math(); | ||
115 | } | ||
116 | return err; | ||
108 | } | 117 | } |
109 | 118 | ||
110 | /* | 119 | /* |
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index 3f18d73f420c..513caaca7115 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -1131,7 +1131,14 @@ asmlinkage void math_state_restore(void) | |||
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | clts(); /* Allow maths ops (or we recurse) */ | 1133 | clts(); /* Allow maths ops (or we recurse) */ |
1134 | restore_fpu_checking(&me->thread.xstate->fxsave); | 1134 | /* |
1135 | * Paranoid restore. send a SIGSEGV if we fail to restore the state. | ||
1136 | */ | ||
1137 | if (unlikely(restore_fpu_checking(&me->thread.xstate->fxsave))) { | ||
1138 | stts(); | ||
1139 | force_sig(SIGSEGV, me); | ||
1140 | return; | ||
1141 | } | ||
1135 | task_thread_info(me)->status |= TS_USEDFPU; | 1142 | task_thread_info(me)->status |= TS_USEDFPU; |
1136 | me->fpu_counter++; | 1143 | me->fpu_counter++; |
1137 | } | 1144 | } |