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

Re: [Xen-devel] [RFC] New shadow paging code

Tim Deegan wrote:

Our code must deal differently with all the different combinations of
shadow modes.  However, we expect that once a guest reaches its target
paging mode, it will stay in that mode for a long time; and the host will
never change its paging mode.  Rather than having a whole string of ifs in
the code based on the current guest and host paging modes, we compile
different code to deal with each pair of modes (2-on-2, 2-on-3, 2-on-4,
3-on-3, 3-on-4, 4-on-4).  (Direct mode is implemented as a special case of
m-on-m, where m is the host's current paging level.)  While increasing the
size of the hypervisor overall, this should greatly decrease both the cache
footprint of the shadow code and reduce pipeline flushes from mispredicted

Can you explain how this works? It is not obvious to me from the patch. In shadow2.c there is in fact a whole string of #ifs. What mechanism causes the file to be multiply compiled? Or do I misunderstand how this works?

Also, can you comment on the differences and similarities with the shadow code contributed by Ben Thomas?


Mike Day

Xen-devel mailing list



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