xen: implement updated XENMEM_add_to_physmap_range ABI
authorIan Campbell <ian.campbell@citrix.com>
Wed, 20 Feb 2013 03:00:58 +0000 (22:00 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 20 Feb 2013 03:01:55 +0000 (22:01 -0500)
Allows for more fine grained error reporting. Only used by PVH and
ARM both of which are marked EXPERIMENTAL precisely because the ABI
is not yet stable

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
[v1: Rebased without PVH patches]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/arm/xen/enlighten.c
include/xen/interface/memory.h

index 7a32976..8dc0605 100644 (file)
@@ -59,14 +59,16 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn,
        };
        xen_ulong_t idx = fgmfn;
        xen_pfn_t gpfn = lpfn;
+       int err = 0;
 
        set_xen_guest_handle(xatp.idxs, &idx);
        set_xen_guest_handle(xatp.gpfns, &gpfn);
+       set_xen_guest_handle(xatp.errs, &err);
 
        rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp);
-       if (rc) {
-               pr_warn("Failed to map pfn to mfn rc:%d pfn:%lx mfn:%lx\n",
-                       rc, lpfn, fgmfn);
+       if (rc || err) {
+               pr_warn("Failed to map pfn to mfn rc:%d:%d pfn:%lx mfn:%lx\n",
+                       rc, err, lpfn, fgmfn);
                return 1;
        }
        return 0;
index b40a431..2ecfe4f 100644 (file)
@@ -190,6 +190,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_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 */
@@ -203,6 +204,11 @@ struct xen_add_to_physmap_range {
 
     /* GPFN in domid where the source mapping page should appear. */
     GUEST_HANDLE(xen_pfn_t) gpfns;
+
+    /* OUT */
+
+    /* Per index error code. */
+    GUEST_HANDLE(int) errs;
 };
 DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range);