mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
x86/shadow: reduce explicit log-dirty recording for HVM
validate_guest_pt_write(), by calling sh_validate_guest_entry(), already guarantees the needed update of log-dirty information. Move the operation into the sole code path needing it (when SHOPT_SKIP_VERIFY is enabled), making clear that only one such call is needed. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
0acaba1257
commit
ff78502db0
1 file changed
+1
-2
@@ -665,6 +665,7 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
|
||||
{
|
||||
/* Writes with this alignment constraint can't possibly cross pages. */
|
||||
ASSERT(!mfn_valid(sh_ctxt->mfn[1]));
|
||||
paging_mark_dirty(v->domain, sh_ctxt->mfn[0]);
|
||||
}
|
||||
else
|
||||
#endif /* SHADOW_OPTIMIZATIONS & SHOPT_SKIP_VERIFY */
|
||||
@@ -682,12 +683,10 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
|
||||
validate_guest_pt_write(v, sh_ctxt->mfn[1], addr + b1, b2);
|
||||
}
|
||||
|
||||
paging_mark_dirty(v->domain, sh_ctxt->mfn[0]);
|
||||
put_page(mfn_to_page(sh_ctxt->mfn[0]));
|
||||
|
||||
if ( unlikely(mfn_valid(sh_ctxt->mfn[1])) )
|
||||
{
|
||||
paging_mark_dirty(v->domain, sh_ctxt->mfn[1]);
|
||||
put_page(mfn_to_page(sh_ctxt->mfn[1]));
|
||||
vunmap((void *)((unsigned long)addr & PAGE_MASK));
|
||||
}
|
||||
|
||||