diff options
author | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2012-01-26 12:46:26 +0000 |
---|---|---|
committer | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2012-01-26 12:46:26 +0000 |
commit | 3881f1a903ada4573be2eec5458a1defe5a34313 (patch) | |
tree | e8801efb5b90a2c87c29f4e6c0788823d32a5e2f /xen/include/public/domctl.h | |
parent | 76dd1b023d82f0461a6678c4c689a179d9a0c256 (diff) | |
download | xen-3881f1a903ada4573be2eec5458a1defe5a34313.tar.gz xen-3881f1a903ada4573be2eec5458a1defe5a34313.tar.bz2 xen-3881f1a903ada4573be2eec5458a1defe5a34313.zip |
x86/mm: Update mem sharing interface to (re)allow sharing of grants
Previously, the mem sharing code would return an opaque handle to index shared
pages (and nominees) in its global hash table. By removing the hash table, the
new interfaces requires a gfn and a version. However, when sharing grants, the
caller provides a grant ref and a version. Update interface to handle this
case.
The use case for grant sharing is when sharing from within a backend (e.g.
memshr + blktap2), in which case the backend is only exposed to grant
references.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Committed-by: Tim Deegan <tim@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/include/public/domctl.h')
-rw-r--r-- | xen/include/public/domctl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index ca5eb61eeb..457762603e 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -775,6 +775,19 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t); #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID (-10) #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID (-9) +/* The following allows sharing of grant refs. This is useful + * for sharing utilities sitting as "filters" in IO backends + * (e.g. memshr + blktap(2)). The IO backend is only exposed + * to grant references, and this allows sharing of the grefs */ +#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG (1ULL << 62) + +#define XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(field, val) \ + (field) = (XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG | val) +#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(field) \ + ((field) & XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG) +#define XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(field) \ + ((field) & (~XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG)) + struct xen_domctl_mem_sharing_op { uint8_t op; /* XEN_DOMCTL_MEM_EVENT_OP_* */ |