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

[Xen-changelog] [xen-unstable] xen: Simplify the space of spaces supported by XENMEM_add_to_physmap(_range)


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 04 Feb 2013 15:44:24 +0000
  • Delivery-date: Mon, 04 Feb 2013 15:44:29 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1359031676 0
# Node ID 1881713c6a20fdd698eaa482cd69067bf4c7c248
# Parent  a26b37fdfd3d4a124338073089fae52624912ce2
xen: Simplify the space of spaces supported by XENMEM_add_to_physmap(_range)

XENMAPSPACE_gmfn_foreign is not supported by XENMEM_add_to_physmap.

Although in theory XENMEM_add_to_physmap_range could support
XENMAPSPACE_gmfn_range this is no different to
XENMAPSPACE_gmfn in the context of the ranged hypercall so disallow it
to avoid any confusion.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r a26b37fdfd3d -r 1881713c6a20 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c Thu Jan 24 12:47:55 2013 +0000
+++ b/xen/arch/arm/mm.c Thu Jan 24 12:47:56 2013 +0000
@@ -680,7 +680,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
-        /* This one is only supported by add_to_physmap_range */
+        /* Foreign mapping is only supported by add_to_physmap_range */
         if ( xatp.space == XENMAPSPACE_gmfn_foreign )
             return -EINVAL;
 
@@ -711,6 +711,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( copy_from_guest(&xatpr, arg, 1) )
             return -EFAULT;
 
+        /* This mapspace is redundant for this hypercall */
+        if ( xatpr.space == XENMAPSPACE_gmfn_range )
+            return -EINVAL;
+
         rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
         if ( rc != 0 )
             return rc;
diff -r a26b37fdfd3d -r 1881713c6a20 xen/include/public/memory.h
--- a/xen/include/public/memory.h       Thu Jan 24 12:47:55 2013 +0000
+++ b/xen/include/public/memory.h       Thu Jan 24 12:47:56 2013 +0000
@@ -203,8 +203,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_machphys_map
 #define XENMAPSPACE_shared_info  0 /* shared info page */
 #define XENMAPSPACE_grant_table  1 /* grant table page */
 #define XENMAPSPACE_gmfn         2 /* GMFN */
-#define XENMAPSPACE_gmfn_range   3 /* GMFN range */
-#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom */
+#define XENMAPSPACE_gmfn_range   3 /* GMFN range, XENMEM_add_to_physmap only. 
*/
+#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom,
+                                    * XENMEM_add_to_physmap_range only.
+                                    */
 /* ` } */
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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