PERFORCE change 76006 for review

David Xu davidxu at freebsd.org
Tue Apr 26 16:06:56 PDT 2005


Scott Long wrote:

> David Xu wrote:
>
>> http://perforce.freebsd.org/chv.cgi?CH=76006
>>
>> Change 76006 by davidxu at davidxu_tiger on 2005/04/26 14:07:21
>>
>>     Add a temp stack for sysenter syscall since debug trap and nmi
>>     can occur before sysenter entry setup its stack.
>
>
>
> Are you aware that there is already a sysenter implementation in 
> perforce?  Please take a look at //depot/user/jeffr/sysenter
>
> Scott
>
>
I didn't know, are you working on it ? I know peter was
trying to work on it.

Just read some code in exception.s:

sysenter_exit:
              |        popl    %fs
              |        popl    %es
              |        popl    %ds
295:          |        popal
              |        addl    $8,%esp
              |        movl    %edx,%ebx               /* Save the old edx value. */
              |        popl    %edx                    /* Pop user's EIP */
              |        addl    $4,%esp
300:          |        popfl
              |        popl    %ecx                    /* Pop user's esp */
              |        sysexit

This code is buggy, popfl enable interrupts, if thread is preempted,
kernel code will use userland %ds, %es, and %fs, this is not good.






More information about the p4-projects mailing list