@@ -740,7 +740,6 @@ asmlinkage void math_state_restore(void)
struct task_struct *tsk = thread->task;
if (!tsk_used_math(tsk)) {
- local_irq_enable();
/*
* does a slab alloc which can sleep
*/
@@ -751,7 +750,6 @@ asmlinkage void math_state_restore(void)
do_group_exit(SIGKILL);
return;
}
- local_irq_disable();
}
clts(); /* Allow maths ops (or we recurse) */
@@ -774,21 +772,20 @@ void math_emulate(struct math_emu_info *info)
dotraplinkage void __kprobes
do_device_not_available(struct pt_regs *regs, long error_code)
{
+ preempt_disable();
+ local_irq_enable();
#ifdef CONFIG_X86_32
if (read_cr0() & X86_CR0_EM) {
struct math_emu_info info = { };
- conditional_sti(regs);
-
info.regs = regs;
math_emulate(&info);
- } else {
- math_state_restore(); /* interrupts still off */
- conditional_sti(regs);
- }
+ } else
+ math_state_restore();
#else
math_state_restore();
#endif
+ preempt_enable();
}
#ifdef CONFIG_X86_32