* new hypercall implementation question
@ 2009-07-23 14:31 Dan Magenheimer
2009-07-23 21:26 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 3+ messages in thread
From: Dan Magenheimer @ 2009-07-23 14:31 UTC (permalink / raw)
To: Xen-Devel (E-mail)
Is it safe to pass three guest virtual addresses via a hypercall
to Xen and expect Xen to safely copy data (two scalars and one
array of pagesize-bytes... not necessarily aligned on a page
boundary) back to the guest, or do I need to do something fancy
to avoid weird corner cases, e.g. to ensure restartabililty
in case of guest page fault?
This is a privileged-only hypercall used only as part of
save/restore/live-migrate (for tmem) if that is relevant.
Thanks,
Dan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: new hypercall implementation question
2009-07-23 14:31 new hypercall implementation question Dan Magenheimer
@ 2009-07-23 21:26 ` Jeremy Fitzhardinge
2009-07-23 21:39 ` Dan Magenheimer
0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Fitzhardinge @ 2009-07-23 21:26 UTC (permalink / raw)
To: Dan Magenheimer; +Cc: Xen-Devel (E-mail)
On 07/23/09 07:31, Dan Magenheimer wrote:
> Is it safe to pass three guest virtual addresses via a hypercall
> to Xen and expect Xen to safely copy data (two scalars and one
> array of pagesize-bytes... not necessarily aligned on a page
> boundary) back to the guest, or do I need to do something fancy
> to avoid weird corner cases, e.g. to ensure restartabililty
> in case of guest page fault?
>
> This is a privileged-only hypercall used only as part of
> save/restore/live-migrate (for tmem) if that is relevant.
>
For x86 its OK to pass kernel vaddrs to Xen and have it interpret them
with the current pagetable. There should be no pagefaults, or rather,
the hypercall will fail with EFAULT.
I think ia64 has problems with anything other than physical addresses
being passed, and has to do all that handle stuff to convert.
J
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: new hypercall implementation question
2009-07-23 21:26 ` Jeremy Fitzhardinge
@ 2009-07-23 21:39 ` Dan Magenheimer
0 siblings, 0 replies; 3+ messages in thread
From: Dan Magenheimer @ 2009-07-23 21:39 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Xen-Devel (E-mail)
> On 07/23/09 07:31, Dan Magenheimer wrote:
> > Is it safe to pass three guest virtual addresses via a hypercall
> > to Xen and expect Xen to safely copy data (two scalars and one
> > array of pagesize-bytes... not necessarily aligned on a page
> > boundary) back to the guest, or do I need to do something fancy
> > to avoid weird corner cases, e.g. to ensure restartabililty
> > in case of guest page fault?
> >
> > This is a privileged-only hypercall used only as part of
> > save/restore/live-migrate (for tmem) if that is relevant.
> >
>
> For x86 its OK to pass kernel vaddrs to Xen and have it interpret them
> with the current pagetable. There should be no pagefaults, or rather,
> the hypercall will fail with EFAULT.
>
> I think ia64 has problems with anything other than physical addresses
> being passed, and has to do all that handle stuff to convert.
Thanks for the reply. After sending, I remembered that
the "proper" way to do this in Xen tools is to bracket
the hypercall with lock_pages/unlock_pages for any vaddr
passed to the hypercall. I hope that's not too horribly
expensive.
Thanks,
Dan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-23 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 14:31 new hypercall implementation question Dan Magenheimer
2009-07-23 21:26 ` Jeremy Fitzhardinge
2009-07-23 21:39 ` Dan Magenheimer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.