diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2013-02-19 22:00:58 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-02-19 22:01:55 -0500 |
commit | 07d0c943663f82d9682856c0a7db7145a6c911d6 (patch) | |
tree | 371eaccc190f1b79010b063bd4497c21d0e40571 | |
parent | dacd45f4e793e46e8299c9a580e400866ffe0770 (diff) |
xen: implement updated XENMEM_add_to_physmap_range ABI
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>
-rw-r--r-- | arch/arm/xen/enlighten.c | 8 | ||||
-rw-r--r-- | include/xen/interface/memory.h | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 7a32976fa2a3..8dc0605a9ce9 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -59,14 +59,16 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn, | |||
59 | }; | 59 | }; |
60 | xen_ulong_t idx = fgmfn; | 60 | xen_ulong_t idx = fgmfn; |
61 | xen_pfn_t gpfn = lpfn; | 61 | xen_pfn_t gpfn = lpfn; |
62 | int err = 0; | ||
62 | 63 | ||
63 | set_xen_guest_handle(xatp.idxs, &idx); | 64 | set_xen_guest_handle(xatp.idxs, &idx); |
64 | set_xen_guest_handle(xatp.gpfns, &gpfn); | 65 | set_xen_guest_handle(xatp.gpfns, &gpfn); |
66 | set_xen_guest_handle(xatp.errs, &err); | ||
65 | 67 | ||
66 | rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp); | 68 | rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp); |
67 | if (rc) { | 69 | if (rc || err) { |
68 | pr_warn("Failed to map pfn to mfn rc:%d pfn:%lx mfn:%lx\n", | 70 | pr_warn("Failed to map pfn to mfn rc:%d:%d pfn:%lx mfn:%lx\n", |
69 | rc, lpfn, fgmfn); | 71 | rc, err, lpfn, fgmfn); |
70 | return 1; | 72 | return 1; |
71 | } | 73 | } |
72 | return 0; | 74 | return 0; |
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index b40a4315cb8b..2ecfe4f700d9 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -190,6 +190,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); | |||
190 | 190 | ||
191 | #define XENMEM_add_to_physmap_range 23 | 191 | #define XENMEM_add_to_physmap_range 23 |
192 | struct xen_add_to_physmap_range { | 192 | struct xen_add_to_physmap_range { |
193 | /* IN */ | ||
193 | /* Which domain to change the mapping for. */ | 194 | /* Which domain to change the mapping for. */ |
194 | domid_t domid; | 195 | domid_t domid; |
195 | uint16_t space; /* => enum phys_map_space */ | 196 | uint16_t space; /* => enum phys_map_space */ |
@@ -203,6 +204,11 @@ struct xen_add_to_physmap_range { | |||
203 | 204 | ||
204 | /* GPFN in domid where the source mapping page should appear. */ | 205 | /* GPFN in domid where the source mapping page should appear. */ |
205 | GUEST_HANDLE(xen_pfn_t) gpfns; | 206 | GUEST_HANDLE(xen_pfn_t) gpfns; |
207 | |||
208 | /* OUT */ | ||
209 | |||
210 | /* Per index error code. */ | ||
211 | GUEST_HANDLE(int) errs; | ||
206 | }; | 212 | }; |
207 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); | 213 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); |
208 | 214 | ||