summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/fpu
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-11-23 07:18:09 +0100
committerIngo Molnar <mingo@kernel.org>2016-11-23 07:18:09 +0100
commit064e6a8ba61a751625478f656c6f76a6f37a009e (patch)
treea22d84d037543f74b6c86969c7e87ab799768de9 /arch/x86/kernel/fpu
parentx86/fpu: Remove clts() (diff)
parentMerge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang... (diff)
downloadlinux-064e6a8ba61a751625478f656c6f76a6f37a009e.tar.xz
linux-064e6a8ba61a751625478f656c6f76a6f37a009e.zip
Merge branch 'linus' into x86/fpu, to resolve conflicts
Conflicts: arch/x86/kernel/fpu/core.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/fpu')
-rw-r--r--arch/x86/kernel/fpu/core.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 7d8e2628e82c..e4e97a5355ce 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -461,14 +461,14 @@ void fpu__clear(struct fpu *fpu)
{
WARN_ON_FPU(fpu != &current->thread.fpu); /* Almost certainly an anomaly */
- if (!static_cpu_has(X86_FEATURE_FPU)) {
- /* FPU state will be reallocated lazily at the first use. */
- fpu__drop(fpu);
- } else {
- if (!fpu->fpstate_active) {
- fpu__activate_curr(fpu);
- user_fpu_begin();
- }
+ fpu__drop(fpu);
+
+ /*
+ * Make sure fpstate is cleared and initialized.
+ */
+ if (static_cpu_has(X86_FEATURE_FPU)) {
+ fpu__activate_curr(fpu);
+ user_fpu_begin();
copy_init_fpstate_to_fpregs();
}
}