[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 05/16] x86/shadow: reduce explicit log-dirty recording for HVM


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 22 Mar 2023 10:31:57 +0100
  • 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=g547sFG6TVthbvW3UmsnIygLUVurjYvLE05IGH57lneXb1+wHWMpHoti4mNH/6esgOxIKVjHNJcWZ4XnO7Rh5qv1PvIdIlBWHxORWClwz5Wp+LnM68Vv+bEE2EBCevSnXh6yoDaeNxW4Lq1WHZTxy4dxFh1ZWDk2SQfq1ELetEUfmDZeR9O8fIPv4N2cuN6lsKv7vpCF3I+SFGARWdRPM41iOA1tcaWqi1FzhD6QmGqPRGvPD3dOIe3VdHRVAjHzDAEJ4lRKTesFq8TJZ2QTrdsC9J0Pwt85hgJWqAeAvJHa71f3jFqJJu5rBHAMm9Wfs33QO+lP0H5uZmXBLE1Gjw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eawRySaNBs4vSIrHtUbDc7smNJcFO6XQAWGtQiHm6vwEHg3cKdYPLNfYCfD39oTi8X8dgviTv3rsdDfTuW7SYOFMy9DjjmCLF9MFoaCfCzCCxP6770G96qrWKjTT4UL53SO6xU3rkbn6UgsrOOMOcfjUL0cigASaKLPTWbFdM55sAM9GoxWfpEGWB/KomaQyW6MIKqM0zkXtjFOw45UYBQ5ay+5LMILrrY6vkg0ExBSMw/WNyp98ns7ycOmjQ+h1iQWPQBC8KYiDR6UdwdfMD7BJKkI6mpSiMuuvC/SdH4loT6qxWH0FtowPahsybVqe9pv5YpGfbcH78FaFY+pE9w==
  • 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: Wed, 22 Mar 2023 09:32:01 +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));
     }




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.