WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] page table question!

To: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] page table question!
From: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Date: Thu, 14 Jun 2007 09:27:55 +0100
Cc: "Petersson, Mats" <Mats.Petersson@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, MT Rezaie <mmrezaie@xxxxxxxxx>
Delivery-date: Thu, 14 Jun 2007 01:28:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200706131735.30820.mark.williamson@xxxxxxxxxxxx>
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: <907625E08839C4409CE5768403633E0B02561E12@xxxxxxxxxxxxxxxxx> <200706131735.30820.mark.williamson@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
At 17:35 +0100 on 13 Jun (1181756130), Mark Williamson wrote:
> > > 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.
> >
> > Good question. I have a feeling that the answer is "it doesn't". HAP
> > would probably solve this problem.

When a guest pagetable entry has the Accessed bit clear, its shadow has
the Present bit clear.  This means we will get an extra page fault when
the guest tries to read that area of memory.  In the page-fault handler
we write the Accessed bit into the guest entry, and replace the shadow
entry with one that has the Present bit.  A similar scheme (shadowing
~Dirty with ~Writeable) applies to those entries that have Dirty bits.

The actual moving parts are in the _sh_propagate() function in
arch/x86/mm/shadow/multi.c, which is why that function needs to be told
whether it's handling a read fault, write fault or prefetch operation.

> Don't guests need the dirty bits for their memory management (e.g. mmap) to 
> work correctly? 

Yes, although in fact Xen doesn't quite catch all the cases where those
bits should be set (certain Xen-handled operations that walk the guest
pagetables instead of using the shadows) and it's not tripped us up
yet. :)

> Maybe one could do something scary like trapping reads to 
> guest PTEs, enabling Xen to refer to the real PTE...  Sounds a bit gross 
> though.

It was considered. :)  (For good reasons; talk to Michael Fetterman
some time.)

> HAP is definitely HAPpier :-)

Yep, should see a significant performance increase and eliminate a lot
of moving parts.

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, XenSource UK Limited
Registered office c/o EC2Y 5EB, UK; company number 05334508

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel