]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/traps_64.c
x86, xsave: context switch support using xsave/xrstor
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / traps_64.c
index 3f18d73f420c414d809a1046dd5676b992e8676e..38eb76156a470a576103d3ec57ebc135e1ecaf39 100644 (file)
@@ -1131,7 +1131,14 @@ asmlinkage void math_state_restore(void)
        }
 
        clts();                         /* Allow maths ops (or we recurse) */
-       restore_fpu_checking(&me->thread.xstate->fxsave);
+       /*
+        * Paranoid restore. send a SIGSEGV if we fail to restore the state.
+        */
+       if (unlikely(restore_fpu_checking(me))) {
+               stts();
+               force_sig(SIGSEGV, me);
+               return;
+       }
        task_thread_info(me)->status |= TS_USEDFPU;
        me->fpu_counter++;
 }
@@ -1165,10 +1172,6 @@ void __init trap_init(void)
 #ifdef CONFIG_IA32_EMULATION
        set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
 #endif
-       /*
-        * initialize the per thread extended state:
-        */
-       init_thread_xstate();
        /*
         * Should be a barrier for any external CPU state:
         */