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] Shadow pagetable code changes since 3.0.2

To: Yongjun Jeon <yongjunj@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Shadow pagetable code changes since 3.0.2
From: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Date: Wed, 11 Jul 2007 09:37:24 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 11 Jul 2007 01:35:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <Pine.LNX.4.64-044.0707091549180.8255@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: <Pine.LNX.4.64-044.0707091549180.8255@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
At 16:02 -0400 on 09 Jul (1183996971), Yongjun Jeon wrote:
> I noticed that the shadow pagetable code has went through some serious 
> design change since 3.0.2, and I couldn't find a good documentation that 
> explains how the old code maps to the new code.
> 
> Can anyone please explain the exact nature of the change - how the new 
> functions replace the old ones?

The architecture of the shadow code changed considerably after 3.0.2; I
doubt you will have much luck porting that patchset directly.
The major change is that instead of "unhooking" shadow pages from the
hierarchy when a guest writes to a pagetable, and re-syncing the shadow
to the pagetable afterwards, we trap and emulate writes to pagetables, 
synchronously updating the shadows as we go.  But also the way shadow
pagetables are allocated, tracked, protected and destroyed have
changed.

Most of the moving parts of the shadow code (including the shadow lock)
are now private to the arch/x86/mm/shadow directory.  Outside callers
use the functions in asm-x86/paging.h, which dispatch to shadow code or
to hardware paging assistance as appropriate.

The p2m table is now organised as a pagetable, and managed by
arch/x86/mm/p2m.c I expect that most of the changes you will want to
make are in there; changes to the p2m map are reflected automatically in
the shadow pagetables by the callback to paging_write_p2m_entry().

For data pages, the function sh_get_page_from_l1e() handles reference
counting and will need to know about the extra domain ID used.  For
pagetable pages, shadow_promote() still exists and would be a good place
to make sure the promoted page is not copy-on-write.

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

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