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

[PATCH 7/8] x86/shadow: don't open-code copy_domain_page()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 21 Dec 2022 14:27:44 +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=KksW3pwduy9TjDQH+MFwFhDkAzwXMmeF0LkQ/h+RxKI=; b=k96KxKfNglSIJqDeAvnet79qcSSsG/EX/+NPkwWGMSSQ/JLmV9JETYjk8Zsxv4xhD44HcNkf1I1ajG+gw9ma+FADNCDjfsrdo/B2uynJ+oP83OAnTeSmWk043uBqnkpeDkNBCxKN9Gkyv+HGbqRmWV5gYBtSKA2Dk34aS44w7JVL1zQvzP4BA01OFy6Zdtu1Y6URR6F+jMj4l/+H4qJ9nscERO61SY/anCMoao2ww5690Sn77Iyz8aGDh8AMgXJg+3X+SFXC9vWeTp5h+MNthCDQiJ4y4DRYjWfGw3Z0UNdoQ1iqbQ3MT/fOSB4UO4f8lTq2YrS5cbGypwTSKdjDMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SjJmeMp1lzrElVK3f/hVnEarT0JTe5nQ08DWZq9pq4INx0+rKIzPvsWZjU5dbvHfbHd6uDREvUqRkyaVxPHtCyqURUiziX2bJkDCpbKeO0blVlO5JqJ4r4b8zKwSdEDVcluayKo5sVKM3xkf/seCtotM6qBHZuzvSQH8+ZfP7jtuBkN7r7Bz+nNAykdXL6nbtsOXy8D/nOCBPi/KV7Y3UxFoQGVILObvbuUNmVXUZ+p/wdx3ijG3TF92E7NB3j5ZXE97qoPANJrTkvuHTj2rgoX9FbEekf10VdBw8/wAh/81LPUXqgW4y5qpmp5EBgAdQO183EvDXJnAlgh0LM2+Xg==
  • 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, 21 Dec 2022 13:35:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Let's use the library-like function that we have.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -455,7 +455,6 @@ static void _sh_resync(struct vcpu *v, m
 static void oos_hash_add(struct vcpu *v, mfn_t gmfn)
 {
     int i, idx, oidx, swap = 0;
-    void *gptr, *gsnpptr;
     mfn_t *oos = v->arch.paging.shadow.oos;
     mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
     struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
@@ -488,11 +487,7 @@ static void oos_hash_add(struct vcpu *v,
     if ( swap )
         SWAP(oos_snapshot[idx], oos_snapshot[oidx]);
 
-    gptr = map_domain_page(oos[oidx]);
-    gsnpptr = map_domain_page(oos_snapshot[oidx]);
-    memcpy(gsnpptr, gptr, PAGE_SIZE);
-    unmap_domain_page(gptr);
-    unmap_domain_page(gsnpptr);
+    copy_domain_page(oos_snapshot[oidx], oos[oidx]);
 }
 
 /* Remove an MFN from the list of out-of-sync guest pagetables */




 


Rackspace

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