Subject: Re: multiple references to p -> v mappings
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 09/11/2005 14:09:34
On Sun, Sep 11, 2005 at 08:04:27PM +0200, Manuel Bouyer wrote:
> On Sun, Sep 11, 2005 at 10:38:03AM -0700, Chuck Silvers wrote:
> > hi,
> > 
> > what's wrong with just mapping the page twice in domain0?
> 
> It seems that the hypervisor doesn't allow multiple mappings in this case.
> Either multiple mappings in the same domain (one remplacing the other)
> or mapping of the page in both domain0 and the guest.
> The Xen doc isn't clear about this, at several place it's implied that
> the page must be unmapped from domain0 before the I/O is ack'd to the
> guest. So even if multiple mappings work, I need to keep track of which
> request use which pages, to ack the requests only once the no mappings
> remain.

whacky.  if that's really required, then you'll also need to synchronize
mapping of new pages in domain0 with acks of old pages which have just
been unmapped.  ie., once you've decided to ack the old request you'll
need to defer processing a new request that uses the same page until
after the ack completes.

actually, to avoid livelock, you should probably not defer acks at all,
but rather defer processing of a new request that uses the same page
until after the previous request is ack'd.  or maybe some mixture of these.

there's no code already in the system that will do quite what you want.
I would suggest using a new hash table to track pages used by these
requests-in-progress.

-Chuck