Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-06-04 Thread Michael S. Tsirkin
On Thu, Apr 09, 2009 at 12:30:57PM -0400, Gregory Haskins wrote: +static unsigned long +task_memctx_copy_to(struct vbus_memctx *ctx, void *dst, const void *src, + unsigned long n) +{ + struct task_memctx *tm = to_task_memctx(ctx); + struct task_struct *p = tm-task; +

Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-06-04 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Thu, Apr 09, 2009 at 12:30:57PM -0400, Gregory Haskins wrote: +static unsigned long +task_memctx_copy_to(struct vbus_memctx *ctx, void *dst, const void *src, +unsigned long n) +{ +struct task_memctx *tm = to_task_memctx(ctx); +struct

Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-06-04 Thread Avi Kivity
Michael S. Tsirkin wrote: Also - if we just had vmexit because a process executed io (or hypercall), can't we just do copy_to_user there? Avi, I think at some point you said that we can? You can do copy_to_user() whereever it is legal in Linux. Almost all of kvm runs in process context,

Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-06-04 Thread Avi Kivity
Gregory Haskins wrote: BTW, why did you decide to use get_user_pages? Would switch_mm + copy_to_user work as well avoiding page walk if all pages are present? Well, basic c_t_u() won't work because its likely not current if you are updating the ring from some other task, but I

Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-06-04 Thread Gregory Haskins
Avi Kivity wrote: Gregory Haskins wrote: BTW, why did you decide to use get_user_pages? Would switch_mm + copy_to_user work as well avoiding page walk if all pages are present? Well, basic c_t_u() won't work because its likely not current if you are updating the ring from some

Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-06-04 Thread Avi Kivity
Gregory Haskins wrote: Oh, I don't doubt that (in fact, I was pretty sure that was the case based on some of the optimizations I could see in studying the c_t_u() path). I just didn't realize there were other ways to do it if its a non current task. ;) I guess the enigma for me right now is

[RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

2009-04-09 Thread Gregory Haskins
We expect to have various types of connection-clients (e.g. userspace, kvm, etc), each of which is likely to have common access patterns and marshalling duties. Therefore we create a client API to simplify client development by helping with mundane tasks such as handle-2-pointer translation, etc.