opensubscriber
   Find in this group all groups
 
Unknown more information…

f : freebsd-hackers@freebsd.org 19 June 2012 • 2:56AM -0400

Fast syscalls via sysenter
by Daniil Cherednik

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi!

I am trying to continue the work started by DavidXu on implemention of fast
syscalls via sysenter/sysexit.
http://people.freebsd.org/~davidxu/sysenter/kernel/
I have ported it on FreeBSD9. It looks like it works. Unfortunately I am a
beginner in kernel so I have some questions:

1. see http://people.freebsd.org/~davidxu/sysenter/kernel/kernel.patch
/*
* If %edx was changed, we can not use sysexit, because it
* needs %edx to restore userland %eip.
*/
if (orig_edx != frame.tf_edx)
td->td_pcb->pcb_flags |= PCB_FULLCTX;

What is the reason why we have to do this additional check? In
http://people.freebsd.org/~davidxu/sysenter/kernel/sysenter.s
we store %edx to the stack in
pushl %edx /* ring 3 next %eip */
and we restore the register in
popl %edx /* ring 3 %eip */

2. see http://people.freebsd.org/~davidxu/sysenter/kernel/sysenter.s
movl PCPU(CURPCB),%esi
call syscall

Why do we  movl PCPU(CURPCB),%esi before calling syscall? syscall is just c-
function.


--
Daniil Cherednik

_______________________________________________
freebsd-hackers@free... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@free..."

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.