[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/12] x86/shadow: reduce explicit log-dirty recording for HVM
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 16 May 2023 09:37:58 +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=pGINYhnPXGwClXBqXIKbDyrF0P+Sfo8bCBfLUCWu++0=; b=cLq+2yA0Y/wqyUcmk6kq3WKE520qYaO02tZRLok+o3vhzx6EIhrozIzyZULeJSR6BKsXraS79X6E5fvPJ7t6YJZYiGe9GGX++eN/rofN6YcYs/46ETYlMa9+UgYlpv8YTy3ELcnhgTXKnHODfSg0OhtS7DMm5vOiaI+Ujsj4IIrlaABahZyb6OoN+opbVApdQDV3DbmNSg3YARCFFtNxxdc/tGGvVw+g04tIG+SHkBMidW5w9s22o6NToZih3oeit0aMV8p+ogZ2yUn7e3BOvusDe5xg8qXTXqWgRNmdTV+gdoC3Hb1GzqjBrwtbOGPL0BLLiFiKiZNczO/qHMfT7Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yber5EyOc9aXzPiJPMYSKpM3Vm9k4NS/Piv9Je2csp1OxZSGVw+iwEXOzpEdZOIHrB9aonpOmQkyp8uwsCDW4oNAygkDDwKAoty+Z0UW3WUrVqeqy0y/qyQm6YNkaEV4noMwAq2otc7L3L/1iZemgLvIqyS5fZasV9u+uJaSZ9ztjZHTEWhLfS6CzBXmH9XZu7CxNET5RUzL+FwS7yafjiZbcE2oz4sDE5+tyWf9eSd0o8nDf/eJv3hzIJynVpSTs2M3Wcy4qln+QvcOQAeZ58dx2CE4txouvsRz/qiDvWdKEY2+HVv0pCvoa8ZsxfepXtp82y3gad81zVtxWi9eEw==
- 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: Tue, 16 May 2023 07:38:05 +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
@@ -644,6 +644,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 */
@@ -661,12 +662,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));
}
|