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

[Xen-changelog] [xen-unstable] xen: return a per-mapping error from XENMEM_add_to_physmap_range.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Sat, 19 Jan 2013 01:33:09 +0000
  • Delivery-date: Sat, 19 Jan 2013 01:33:18 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1358441303 0
# Node ID 15a02be467b5ba2cc1dd0eb80e6355af5cb19567
# Parent  afe9bed5e25bd02daf7adcdd31777bb54f0ee567
xen: return a per-mapping error from XENMEM_add_to_physmap_range.

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@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
Acked-by: Mats Petersson <mats.petersson@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r afe9bed5e25b -r 15a02be467b5 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c Thu Jan 17 16:48:22 2013 +0000
+++ b/xen/arch/arm/mm.c Thu Jan 17 16:48:23 2013 +0000
@@ -612,6 +612,10 @@ static int xenmem_add_to_physmap_range(s
                                        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 */
diff -r afe9bed5e25b -r 15a02be467b5 xen/include/public/memory.h
--- a/xen/include/public/memory.h       Thu Jan 17 16:48:22 2013 +0000
+++ b/xen/include/public/memory.h       Thu Jan 17 16:48:23 2013 +0000
@@ -236,6 +236,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_add_to_physm
 /* 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);

_______________________________________________
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®.