Merge branches 'x86/acpi', 'x86/apic', 'x86/cpudetect', 'x86/headers', 'x86/paravirt...
[safe/jmp/linux-2.6] / arch / x86 / kernel / traps.c
index bde57f0..acb8c05 100644 (file)
@@ -98,6 +98,12 @@ static inline void preempt_conditional_sti(struct pt_regs *regs)
                local_irq_enable();
 }
 
+static inline void conditional_cli(struct pt_regs *regs)
+{
+       if (regs->flags & X86_EFLAGS_IF)
+               local_irq_disable();
+}
+
 static inline void preempt_conditional_cli(struct pt_regs *regs)
 {
        if (regs->flags & X86_EFLAGS_IF)
@@ -625,8 +631,10 @@ clear_dr7:
 
 #ifdef CONFIG_X86_32
 debug_vm86:
+       /* reenable preemption: handle_vm86_trap() might sleep */
+       dec_preempt_count();
        handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1);
-       preempt_conditional_cli(regs);
+       conditional_cli(regs);
        return;
 #endif