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;
+
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
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,
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
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
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
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.