This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

To: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [RFC] New shadow paging code
From: "Mike D. Day" <ncmike@xxxxxxxxxx>
Date: Mon, 17 Jul 2006 10:32:08 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 17 Jul 2006 07:32:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060714153907.GJ3328@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060714153907.GJ3328@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (Macintosh/20060530)
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

<Prev in Thread] Current Thread [Next in Thread>