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

Re: [Xen-devel] Sharing Memory between userspace of dom0 and userspace of domU

On Tue, 2008-02-19 at 13:34 -0500, Mike Sun wrote:
> Thanks Daniel, Derek.  I think that cleared up a good number of things for me.
> Regarding page table pages...  you mentioned:
> > Xen never swaps out domain pages. So there's no need to pin them on the
> > side of the VMM. I believe that will answer your original question
> > regarding swapping out of domain page tables.
> My question is what would happen if the guest OS swaps out page table
> pages and the mfn backing that PT page is now allocated to a normal
> user page.  How would Xen know that the type of that page has changed
> if this were allowed to happen?

The page type refcount drops to zero when the page isn't linked into the
page table structure anymore (see the page_info struct definition in the
Xen source tree for types and refcounts). So the guest just unlinks the
PT frame (via a hypercall). From there on, the guest may reuse the frame
under a writable mapping. Note that this is consistent with overall OS
behavior: First the PT usage is cleared, then the frame reused,
independent of whether the contents are swapped to disk, the process
died, etc.

Vice versa for writable (RW) types: If the guest has a writable mapping
on that page (type=RW, count>0) somewhere, attempts to use it as a PT
frame elsewhere will fail.


Daniel Stodden
LRR     -      Lehrstuhl fÃr Rechnertechnik und Rechnerorganisation
Institut fÃr Informatik der TU MÃnchen             D-85748 Garching
http://www.lrr.in.tum.de/~stodden         mailto:stodden@xxxxxxxxxx
PGP Fingerprint: F5A4 1575 4C56 E26A 0B33  3D80 457E 82AE B0D8 735B

Xen-devel mailing list



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