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
new-guest-walk
Description: Text document
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|