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:
Jan Beulich committed 2026-02-23 08:37:13 +01:00
1 parent 0acaba1257
commit ff78502db0
1 file changed
+1 -2
+1 -2
View File
@@ -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));
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.