Mailing List Archive

dom0 system call efficiency on x86_64
hi,all
I found that the time wasted on calling `sendto` system call is nearly five
times than native kenrel.
After reading some paper and code, I understand that xen seems deal with
system call as follows:

xen's subarch_percpu_traps_init installs syscall handler
`syscall_enter`.
dom0 excutes syscall_init, which installs `system_call`, but
`wrmsrl(MSR_LSTAR, system_call);` does nonting in dom0.
when userland application call sendto system call, xen's syscall_enter
handler excutes, which calls toggle_guest_mode to switch to pseudo-kernel
mode.
create_bounce_frame call guest os's sys_sendto handler.
guest os finaly call iret hypercall return to xen, which calls
toggle_guest_mode again to switch back to userland.

Are these correct?

If that's true, it means that the efficiency of system call in dom0 is very
terrible, because of long call path and two toggle_guest_mode calls which
will invalidates all tlbs.

Is there any optimization ways to deal with x86_64's system call?

Thanks in advence.

--
View this message in context: http://xen.1045712.n5.nabble.com/dom0-system-call-efficiency-on-x86-64-tp5514885p5514885.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: dom0 system call efficiency on x86_64 [ In reply to ]
On 25/02/2012 09:59, "Liu.yi" <liu.yi24@zte.com.cn> wrote:

> hi,all
> I found that the time wasted on calling `sendto` system call is nearly five
> times than native kenrel.
> After reading some paper and code, I understand that xen seems deal with
> system call as follows:
>
> xen's subarch_percpu_traps_init installs syscall handler
> `syscall_enter`.
> dom0 excutes syscall_init, which installs `system_call`, but
> `wrmsrl(MSR_LSTAR, system_call);` does nonting in dom0.
> when userland application call sendto system call, xen's syscall_enter
> handler excutes, which calls toggle_guest_mode to switch to pseudo-kernel
> mode.
> create_bounce_frame call guest os's sys_sendto handler.
> guest os finaly call iret hypercall return to xen, which calls
> toggle_guest_mode again to switch back to userland.
>
> Are these correct?
>
> If that's true, it means that the efficiency of system call in dom0 is very
> terrible, because of long call path and two toggle_guest_mode calls which
> will invalidates all tlbs.

Unfortunately true.

> Is there any optimization ways to deal with x86_64's system call?

Run PV guest in an HVM container, which provides sufficient protection to
allow us to have guest applications syscall directly into guest OS. Mukes
Rathor at Oracle (cc'ed) is working on this.

-- Keir

> Thanks in advence.
>
> --
> View this message in context:
> http://xen.1045712.n5.nabble.com/dom0-system-call-efficiency-on-x86-64-tp55148
> 85p5514885.html
> Sent from the Xen - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: dom0 system call efficiency on x86_64 [ In reply to ]
On Sat, 25 Feb 2012 11:13:31 +0000
Keir Fraser <keir.xen@gmail.com> wrote:

> > Is there any optimization ways to deal with x86_64's system call?
>
> Run PV guest in an HVM container, which provides sufficient
> protection to allow us to have guest applications syscall directly
> into guest OS. Mukes Rathor at Oracle (cc'ed) is working on this.
>
> -- Keir

Yup, with domU hybrid (PV in HVM container), we got expected results.
dom0 hybrid coming soon, currently debugging some ept violation.

thanks,
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: dom0 system call efficiency on x86_64 [ In reply to ]
It's really a good news. Expecting the good job.

--
View this message in context: http://xen.1045712.n5.nabble.com/dom0-system-call-efficiency-on-x86-64-tp5514885p5520504.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel