|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Setting up page directories and tables
On Tuesday 01 May 2007, Dave Pacheco wrote:
> On 4/27/07, Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> wrote:
> > I see from your description that you're pinning L1 pages. That's
> > generally not how Xen linux kernels do it these days; they just pin the
> > whole pagetable from L2 down (in your non-PAE case). Since pinning from
> > top-down is the same as loading cr3 from a validity-checking
> > perspective, it's useful to see if Xen likes your pagetables without
> > actually trashing them (if you load a bad cr3, you end up in limbo with
> > no useful pagetables, and Xen can't even print a useful stack backtrace
> > as it destroys your domain).
>
> 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?
L2 is the top level of the hierarchy, so if you pin it all the L1 (leaf)
pagetables will get validated in the process.
> 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 gets Xen to validate the pagetable. It can subsequently be reloaded
without validation until it's unpinned (otherwise Xen would need to validate
it each time it was loaded into CR3). It basically does this by validating
the pagetable, then bumping the refcounts so that the pages can't be used in
inappropriate ways (e.g. won't let them be mapped RW because that would allow
malicious guests to break out of their memory).
Pinning an L2 table which references L1 tables will cause the L1 tables to be
validated as part of this process (ensuring that they don't contain any
inappropriate mappings).
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
|
|
|
|
|