]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
libxendevicemodel: provide xendevicemodel_pin_memory_cacheattr
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Thu, 25 Jan 2018 11:26:36 +0000 (12:26 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 25 Jan 2018 11:26:36 +0000 (12:26 +0100)
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
tools/libs/devicemodel/core.c
tools/libs/devicemodel/include/xendevicemodel.h
tools/libs/devicemodel/libxendevicemodel.map

index 4ae15e14e4219da6f47c141d562efceec17802d2..23924e9a38605c3ba4aba94883b177729ac4b23f 100644 (file)
@@ -584,6 +584,25 @@ int xendevicemodel_relocate_memory(
     return xendevicemodel_op(dmod, domid, 1, &op, sizeof(op));
 }
 
+int xendevicemodel_pin_memory_cacheattr(
+    xendevicemodel_handle *dmod, domid_t domid, uint64_t start, uint64_t end,
+    uint32_t type)
+{
+    struct xen_dm_op op;
+    struct xen_dm_op_pin_memory_cacheattr *data;
+
+    memset(&op, 0, sizeof(op));
+
+    op.op = XEN_DMOP_pin_memory_cacheattr;
+    data = &op.u.pin_memory_cacheattr;
+
+    data->start = start;
+    data->end = end;
+    data->type = type;
+
+    return xendevicemodel_op(dmod, domid, 1, &op, sizeof(op));
+}
+
 int xendevicemodel_restrict(xendevicemodel_handle *dmod, domid_t domid)
 {
     return osdep_xendevicemodel_restrict(dmod, domid);
index e5e047ee58794269410ed09bd0c7e1bee7c2974b..9b89f328f550f20ee0c4d1f5a1a9bcf7e64af99a 100644 (file)
@@ -339,6 +339,20 @@ int xendevicemodel_relocate_memory(
     xendevicemodel_handle *dmod, domid_t domid, uint32_t size, uint64_t src_gfn,
     uint64_t dst_gfn);
 
+/**
+ * Pins caching type of RAM space.
+ *
+ * @parm dmod a handle to an open devicemodel interface.
+ * @parm domid the domain id to be serviced
+ * @parm start Start gfn
+ * @parm end End gfn
+ * @parm type XEN_DOMCTL_MEM_CACHEATTR_*
+ * @return 0 on success, -1 on failure.
+ */
+int xendevicemodel_pin_memory_cacheattr(
+    xendevicemodel_handle *dmod, domid_t domid, uint64_t start, uint64_t end,
+    uint32_t type);
+
 /**
  * This function restricts the use of this handle to the specified
  * domain.
index 4c967b3159b23483482f16990b8e84cbaa288b25..04797b239d7c4a67a4ec8bfc9fe1c8f92922ab7c 100644 (file)
@@ -31,4 +31,5 @@ VERS_1.1 {
 VERS_1.2 {
        global:
                xendevicemodel_relocate_memory;
+               xendevicemodel_pin_memory_cacheattr;
 } VERS_1.1;