Another use of sti in entry.S question

From: Duncan Sands (baldrick@wanadoo.fr)
Date: Thu May 22 2003 - 17:05:14 EST


Here is another place where interrupts get turned on in a called
function:

work_resched disables interrupts and falls through to work_notifysig.
work_notifysig calls do_notify_resume.
do_notify_resume calls do_signal.
do_signal calls get_signal_to_deliver.
get_signal_to_deliver does an spin_unlock_irq before returning,
enabling interrupts.

Is this a bug?

work_resched:
        sti
        call schedule
        cli # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
        movl TI_FLAGS(%ebp), %ecx
        andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
                                        # than syscall tracing?
        jz restore_all
        testb $_TIF_NEED_RESCHED, %cl
        jnz work_resched

work_notifysig: # deal with pending signals and
                                        # notify-resume requests
        testl $VM_MASK, EFLAGS(%esp)
        movl %esp, %eax
        jne work_notifysig_v86 # returning to kernel-space or
                                        # vm86-space
        xorl %edx, %edx
        call do_notify_resume <== may enable interrupts
        jmp restore_all

        ALIGN
work_notifysig_v86:
        pushl %ecx
        call save_v86_state
        popl %ecx
        movl %eax, %esp
        xorl %edx, %edx
        call do_notify_resume <== may enable interrupts
        jmp restore_all
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:51 EST