[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: how to handle paged hypercall args?


  • To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Mon, 15 Nov 2010 11:55:18 +0000
  • Cc: Olaf Hering <olaf@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Patrick Colp <pjcolp@xxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
  • Delivery-date: Mon, 15 Nov 2010 03:56:32 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=uXidhvS9iR0ZjR+JFd/qQWIL2WLDIVjbOWU90FSvqnFeL4vylR78U0eYo/xUgjVi91 oiosIjAh9k00nAoFLzt/FefWZpyZsTaejinaI9EYEYTPga5cNIMP+DT+PnJwJwKt5xq8 qD+sX5cGFPgY1Q+z9OJbSu1f+cXt3ZAQUQPPM=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcuEu/jpx5vi6rjO4kuKEQ5LgHxgQg==
  • Thread-topic: [Xen-devel] Re: how to handle paged hypercall args?

On 15/11/2010 10:49, "Tim Deegan" <Tim.Deegan@xxxxxxxxxx> wrote:

>> We're talking about copy_to/from_guest, and friends, here.
> 
> Oh sorry, I had lost the context there.
> 
> Yes, for those the plan was just to pause and retry, just like all other
> cases where Xen needs to access guest memory.

Could you expand on what you mean by pause and retry? As that's what I think
should be implemented, and involves sleeping in hypervisor context afaics,
which has led us to the current point in the discussion.

> We hadn't particularly
> considered the case of large hypercall arguments that aren't all read
> up-front.  How many cases of that are there?  A bit of reordering on the
> memory-operation hypercalls could presuambly let them be preempted and
> restart further in mid-operation next time.  (IIRC the compat code
> already does something like this).

The issue is that there are hundreds of uses of the guest-accessor macros.
Every single one would need updating to handle the paged-out-so-retry case,
unless we can hide that *inside* the accessor macros themselves. It's a huge
job, not to mention the bug tail on rarely-executed error paths.

Consider also the copy_to_* writeback case at the end of a hypercall. You've
done the potentially non-idempotent work, you have some state cached in
hypervisor regs/stack/heap and want to push it out to guest memory. The
guest target memory is paged out. How do you encode the continuation for the
dozens of cases like this without tearing your hair out?

I suppose *maybe* you could check-and-pin all memory that might be accessed
before the meat of a hypercall begins. That seems a fragile pain in the neck
too however.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.