]> xenbits.xensource.com Git - people/aperard/xen-arm.git/commitdiff
xen: return a per-mapping error from XENMEM_add_to_physmap_range.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 17 Jan 2013 16:48:23 +0000 (16:48 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 17 Jan 2013 16:48:23 +0000 (16:48 +0000)
Since ARM and PVH dom0 kernel use this to map foreign domain pages
they could in the future hit paged out or shared pages etc and
therefore need to propagate which frames are -ENOENT and which failed
for some other reason.

We have not yet released a version of Xen with this particular
hypercall subop so we can change the interface without worrying about
compatibility (I think/hope).

This would be used by the privcmd driver, in particular it relates to
Mats' patch "improve performance of MMAPBATCH_V2."

NB I have only implemented the ARM side since the PVH side isn't in
tree yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Mats Petersson <mats.petersson@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/mm.c
xen/include/public/memory.h

index d97b3ea4afc664c67b8bc0ca279a87b7c29681d3..945e7acb5e66b29fc5273b00f72824fbc3be533e 100644 (file)
@@ -612,6 +612,10 @@ static int xenmem_add_to_physmap_range(struct domain *d,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
 
+        rc = copy_to_guest_offset(xatpr->errs, xatpr->size-1, &rc, 1);
+        if ( rc < 0 )
+            goto out;
+
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
index 3ee290208db800573ebc73dae6d2ae9b345e390e..62acabd021cb7da2af01df20a39a539e3857ce49 100644 (file)
@@ -236,6 +236,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
 /* A batched version of add_to_physmap. */
 #define XENMEM_add_to_physmap_range 23
 struct xen_add_to_physmap_range {
+    /* IN */
     /* Which domain to change the mapping for. */
     domid_t domid;
     uint16_t space; /* => enum phys_map_space */
@@ -247,8 +248,13 @@ struct xen_add_to_physmap_range {
     /* Indexes into space being mapped. */
     XEN_GUEST_HANDLE(xen_ulong_t) idxs;
 
-    /* GPFN in domdwhere the source mapping page should appear. */
+    /* GPFN in domid where the source mapping page should appear. */
     XEN_GUEST_HANDLE(xen_pfn_t) gpfns;
+
+    /* OUT */
+
+    /* Per index error code. */
+    XEN_GUEST_HANDLE(int) errs;
 };
 typedef struct xen_add_to_physmap_range xen_add_to_physmap_range_t;
 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);