[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 03/13] x86/shadow: reduce explicit log-dirty recording for HVM
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 30 Mar 2023 13:26:35 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o37qmZQGz0dUPVarEE5M4F8gAAfRaPl7Obs64dcS6gQ=; b=Dlqt8EZ92XFYkUkX6dsOgfeIPc0lRWiBpHdysauln6eQoLm+6lLMrVxjL6eiC1YyW68PtYB2wrEnA6l9GxxT5JJMDQOhrkXTOXN/lYXQq2NiRMPXS5yQ7yzKA3OrgDQWbgmnDYANSJ6D5YnE9QmCRZ3lUfve7BXM4F8lGxH1vfT6K3S8j4ignFth842VT5mkPjWcYp5EoBMMF9rSNAP8l3I6j18Q/W0pSOcgTM5V9vsmYaN79KwmrIHn4ynM5GcnvgARzXSADk764pziCbNB2jxCNzgqB2YDVlDCxQuba7Q4iOrRlmIBsPuDc9ZQOH8DMb9kZmb8ftRx2kaT70TukQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kawQ88ejvpYSr+SK5zXClVyuo1dvd+jkmp5bnmO2qncx0zmsqa20lcDsPg0BKQQvLdcoyRpEsDdjZBoX9LYqWIMTrykiN0CHgegnba4Z95YMkDsjB9sV4WFOEryekhZ7mKMnPYiD+2iLOpIjtr7M9EWHnO673rvjvmqLnmcKYyR3Nb4DxjzIMm6Z+tvw+byyT9JD6vNafnE1qXunr9Pss64ETSEEF2tzGfgtpJYFeyDDcCksNpfPczjBpjY87YijHBaQ5zAQJgCjVmaoACS9AdD9v3s9MTdlINu2vBPpDm78yrh/UTFU/xZAxOlbi5pi+fNZm5QuTYUzchiDgAn0fA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>
- Delivery-date: Thu, 30 Mar 2023 11:26:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxx>
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -656,6 +656,7 @@ static void sh_emulate_unmap_dest(struct
{
/* 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 */
@@ -673,12 +674,10 @@ static void sh_emulate_unmap_dest(struct
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));
}
|