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

Re: [Xen-devel] page table question!



> > I want to know any difference between writing, reading and shadow page
> > table (for example performance).
>
> Not sure exactly what you're asking for: are you asking about "writable"
> and "non-writable" page-table vs. shadow-page-table?

"Writable pagetables" is an interface introduced for Xen 3 PV guests to update 
their pagetables.  Previous versions of Xen required guests to be modified to 
make every update to their pagetables explicitly call into Xen (and 
explicitly batch those operations).  Writeable pagetables replace this by 
allowing updates to the pagetables to be implemented by the guest as attempts 
to write directly to them.  This isn't a trusted operation, however, since 
Xen uses page protections to prevent unvalidated writes going through...  
Right now this is implemented by trapping each attempt to write to the lower 
levels of the pagetables and emulating it in Xen.  Previous implementations 
were a bit more complicated but found to be unnecessary.

This interface does require the guest to do physical->machine translations 
(which are verified by Xen before installing them), and the guest actually 
works with the real pagetables (subject to certain restrictions).  As a 
result the guest can get data out of the real pagetables by doing a simple 
read - this operation should be as fast as native.  Updating pagetables is 
obviously a bit slower than native because Xen has to emulate them; explicit 
calls to Xen's batched update interface are used to give decent performance 
when lots of PTEs are being modified.

Does that answer your question, Mohammad?

> As of currently, Shadow-mode is only used for HVM (fully virtualized)
> domains. In this case, the guest has a "dummy" page-table that is not
> used by the processor for any memory accesses, instead a "shadow" (copy)
> of the guest's page-table is used. The shadow page-table is used by the
> processor. To make updates to the page-table appear in the
> shadow-page-table, the hypervisor is making sure that the
> guest-page-table is read-only, and when the guest writes to the
> page-table, we reproduce the write [with modification to reflect the
> difference between guest physical and machine physical address].

What Mats said :-)

One thing I've never been clear on for shadow mode is how accessed / dirty 
bits get propagated to the guest pagetable from the shadow.

At some point there was also support in Xen for fully translated shadowing of 
PV guests but I'm not sure this works now.  PV guests do still get shadowed 
in a limited way during live migration, however.

Cheers,
Mark

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

_______________________________________________
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®.