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

[Xen-devel] RFC: shadow A/D-bit-setting changes

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] RFC: shadow A/D-bit-setting changes
From: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Date: Thu, 25 Oct 2007 17:46:21 +0100
Delivery-date: Thu, 25 Oct 2007 09:47:16 -0700
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
User-agent: Mutt/1.5.13 (2006-08-11)
I am considering changing the way that guest pagetables get their
_PAGE_ACCESSED and _PAGE_DIRTY bits set by the shadow code. 

Currently, these bits are set when the corresponding entry is made in
the shadow code -- e.g. when we make a shadow PTE with the _PAGE_RW set
we make sure the guest PTE has the _PAGE_DIRTY bit set.

My plan is to have the pagetable walker (guest_walk_tables()) set the
bits instead.  This has two advantages:
 - we don't need to carry around mappings to the guest pagetables in
   the pagefault handler, which makes things simpler;
 - other users of the walker, such as the various emulators and HVM
   exit handlers, can have correct behaviour about setting these bits.

The disadvantages are, at least:
 - we now need to check for rights at each level of a PT walk, to ensure
   that we don't set a _PAGE_DIRTY bit on a read-only mapping, for example;
 - since guest_walk_tables() can be called without the shadow lock, and
   on pages that are not shadowed yet, we need to use locked cmpxchg to 
   set these bits.

A draft patch is attached, which is incomplete (it doesn't cover callers
of paging_gva_to_gfn, or the HAP walker, and is not optimised -- I am
just starting to measure the performance impact) but smoke-tests OK for
running Windows.

Any comments are welcome -- in particular will this cause problems for
direct-MMIO, HAP or similar paging-related code?

Cheers,

Tim.

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

Attachment: new-guest-walk
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] RFC: shadow A/D-bit-setting changes, Tim Deegan <=