> Ideally you'd replicate all the checks that are done in _sh_propagate
> (guest PTE allows writes, target pfn not read-only, target mfn not
> shadowed, maybe some others I don't remember).
For ease of correctness, would using something like validate_g1le()
make all the checks I need (since it calls _sh_propagate down the
line), assuming I call this while in the context of the same domain as
v->domain:
SHADOW_FOREACH_L2E(sl2mfn, sl2e, 0, done_l2, v->domain,
{
flags_l2 = shadow_l2e_get_flags(*sl2e);
if (flags_l2 & _PAGE_PRESENT)
{
sl1mfn = shadow_l2e_get_mfn(*sl2e);
gl1mfn = _mfn(mfn_to_shadow_page(sl1mfn)->backpointer);
gl1e = gp = sh_map_domain_page(gl1mfn);
SHADOW_FOREACH_L1E(sl1mfn, sl1e, &gl1e, done_l1,
{
flags_l1 = shadow_l1e_get_flags(*sl1e);
if ((flags_l1 & _PAGE_PRESENT) && !(flags_l1 & _PAGE_RW))
{
mfn = shadow_l1e_get_mfn(*sl1e);
pfn = mfn_to_gfn(v->domain, mfn);
log_dirty_lock(v->domain);
if (mfn_valid(mfn) && VALID_M2P(pfn) &&
sh_mfn_is_dirty(v->domain, mfn))
{
if (guest_l1e_get_flags(*gl1e) & _PAGE_RW)
validate_gl1e(v, gl1e, sl1mfn, sl1e);
}
log_dirty_unlock(v->domain);
}
});
}
});
Thanks,
Mike
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|