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] Need information related to shadowing

To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Need information related to shadowing
From: "Sameer Ahuja" <sameer.ahuja@xxxxxxxxxxx>
Date: Tue, 21 Nov 2006 14:16:11 +0530
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 21 Nov 2006 00:49:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AccInn0wZiuboe04T5OhG/L3ZhrSSgEqspaw
Thread-topic: [Xen-devel] Need information related to shadowing
Hi,

DO you have any idea what auditing functions like sh_audit_l3_table()
defined in x86\mm\shadow\multi.c do

Regards,
Sameer


-----Original Message-----
From: Tim Deegan [mailto:Tim.Deegan@xxxxxxxxxxxxx] 
Sent: Wednesday, November 15, 2006 3:44 PM
To: Sameer Ahuja
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] Need information related to shadowing

At 09:41 +0530 on 15 Nov (1163583694), Sameer Ahuja wrote:
> Can you please tell me how is Shadow Page Table generated/maintained?

Shadow pagetables are generated in two places in the shadow code: on a
guest CR3 change a top-level shadow is generated (multi.c:
sh_update_cr3() calls sh_set_toplevel_shadow()), and all other shadows
are
generated in the page fault handler (sh_page_fault() calls
shadow_get_and_create_l1e(), which recursively builds the shadow
tables).

Shadow entries are filled in by the l*e_propagate_from_guest()
functions, which are called directly from the page fault handler and
when we see a write to a guest pagetable (via the
shadow_validate_guest_entry() and shadow_validate_guest_pt_write()
functions).

The control flow is a bit tricky there because we need to track shadows
of different paging modes at the same time: a single page can have up
to eight different shadows.  To deal with different paging modes, the
file multi.c is compiled multiple times, and its functions renamed to
include the paging mode they handle.  We can then call the correct
function by name (see the various dispatch tables in common.c), or call
the functions for the paging mode each vcpu is currently in, via the
v->arch.shadow.mode array of pointers.

Shadows are destroyed when their reference count hits zero, typically
because shadow memory is being reclaimed: shadow_prealloc() un-pins
top-level shadows which causes them to recursively destroy all their
children.

Cheers,

Tim.

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