File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ void __kernel_fpu_begin(void)
114
114
kernel_fpu_disable ();
115
115
116
116
if (fpu -> fpregs_active ) {
117
+ /*
118
+ * Ignore return value -- we don't care if reg state
119
+ * is clobbered.
120
+ */
117
121
copy_fpregs_to_fpstate (fpu );
118
122
} else {
119
123
this_cpu_write (fpu_fpregs_owner_ctx , NULL );
@@ -189,8 +193,12 @@ void fpu__save(struct fpu *fpu)
189
193
190
194
preempt_disable ();
191
195
if (fpu -> fpregs_active ) {
192
- if (!copy_fpregs_to_fpstate (fpu ))
193
- fpregs_deactivate (fpu );
196
+ if (!copy_fpregs_to_fpstate (fpu )) {
197
+ if (use_eager_fpu ())
198
+ copy_kernel_to_fpregs (& fpu -> state );
199
+ else
200
+ fpregs_deactivate (fpu );
201
+ }
194
202
}
195
203
preempt_enable ();
196
204
}
@@ -259,7 +267,11 @@ static void fpu_copy(struct fpu *dst_fpu, struct fpu *src_fpu)
259
267
preempt_disable ();
260
268
if (!copy_fpregs_to_fpstate (dst_fpu )) {
261
269
memcpy (& src_fpu -> state , & dst_fpu -> state , xstate_size );
262
- fpregs_deactivate (src_fpu );
270
+
271
+ if (use_eager_fpu ())
272
+ copy_kernel_to_fpregs (& src_fpu -> state );
273
+ else
274
+ fpregs_deactivate (src_fpu );
263
275
}
264
276
preempt_enable ();
265
277
}
You can’t perform that action at this time.
0 commit comments