From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: Setting up page directories and tables Date: Tue, 01 May 2007 14:42:49 -0700 Message-ID: <4637B459.20801@xensource.com> References: <2d88d46a0704271311m4f41aa6bna46cc903bb619f32@mail.gmail.com> <2d88d46a0704271756t3968218h9f992ff495a6d48c@mail.gmail.com> <46329FF5.5060504@xensource.com> <2d88d46a0705011232m255baf48rd9fda96026ebd64f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <2d88d46a0705011232m255baf48rd9fda96026ebd64f@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dave Pacheco Cc: Joel Weinberger , xen-devel@lists.xensource.com, Jeremy Fitzhardinge List-Id: xen-devel@lists.xenproject.org Dave Pacheco wrote: > I don't really understand what you mean here. To "pin the whole > pagetable from L2 down" - does that mean pinning the L2 pagetable page > itself and then all of the L1 pages, or just the L2 pagetable page? > > What exactly does pinning do? Does it simply ensure that the page > won't be paged out and that Xen knows it's a page table? If that's the > case, it seems like you still want to pin L1 pages so that you know > that Xen is okay with your L1 page table. "Pinning" is a bit of a misnomer. What it means is that the pinned page is always treated as part of an active pagetable (ie, pointed to by %cr3), so all the normal rules apply: it must be RO, and all updates must go through Xen and be validated. This means that Xen doesn't need to revalidate it when it does become an active pagetable. By definition, if you pin a pagetable page, you also pin all the other pagetable pages it refers to. So if you pin the L2 (L3 for PAE) root page, then you're pinning the entire pagetable. You could pin the leaf L1 pages (ie the ones actually containing pte entries), but there's not much point. J