Re: Need help in understanding x86 syscall

From: linux-os (Dick Johnson)
Date: Thu Aug 11 2005 - 10:29:16 EST



On Thu, 11 Aug 2005, Coywolf Qi Hunt wrote:

> On 8/11/05, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>> On Thu, 2005-08-11 at 10:04 -0400, linux-os (Dick Johnson) wrote:
>>> Every interrupt software, or hardware, results in the branched
>>> procedure being executed with the interrupts OFF. That's why
>>> one of the first instructions in the kernel entry for a syscall
>>> is 'sti' to turn them back on. Look at entry.S, line 182. This
>>> occurs any time a trap occurs as well (Page 26-168, i486
>>> Programmer's reference manual). FYI, this is helpful when
>>> designing/debugging complex interrupt-service routines since
>>> you can execute the interrupt with a software 'INT' instruction
>>> (with the correct offset from the IRQ you are using). The software
>>> doesn't 'know' where the interrupt came from, HW or SW.
>>
>> I'm looking at 2.6.13-rc6-git1 line 182 of entry.S and I don't see it.
>> Must be a different kernel.
>>
>> According to the documentation that I was looking at, a trap in x86 does
>> _not_ turn off interrupts.
>>
> ...
>>
>> I don't see a sti here.
>

Search for sysenter_entry. This is where the stack is switched
to the kernel stack. Then the code falls through past the
next label, sysenter_past_esp. The very next instruction
after the kernel stack has been set is 'sti'. Clear as day.

>
>> -- Steve
>
>
> He is RBJ, Richard B. Johnson, the LKML defacto official troll.
>
> --
> Coywolf Qi Hunt
> http://ahbl.org/~coywolf/
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/