]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/kernel/traps.c
x86, fpu: use non-lazy fpu restore for processors supporting xsave
[mirror_ubuntu-artful-kernel.git] / arch / x86 / kernel / traps.c
index b481341c9369da649908b57c3e8c39b1586b0111..ac7d5275f6e8eaa9649a7776f9adbf1034a7fa4e 100644 (file)
@@ -613,11 +613,12 @@ void math_state_restore(void)
        }
 
        __thread_fpu_begin(tsk);
+
        /*
         * Paranoid restore. send a SIGSEGV if we fail to restore the state.
         */
        if (unlikely(restore_fpu_checking(tsk))) {
-               __thread_fpu_end(tsk);
+               drop_init_fpu(tsk);
                force_sig(SIGSEGV, tsk);
                return;
        }
@@ -629,6 +630,8 @@ EXPORT_SYMBOL_GPL(math_state_restore);
 dotraplinkage void __kprobes
 do_device_not_available(struct pt_regs *regs, long error_code)
 {
+       BUG_ON(use_xsave());
+
 #ifdef CONFIG_MATH_EMULATION
        if (read_cr0() & X86_CR0_EM) {
                struct math_emu_info info = { };