From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH v4 5/6] tools: libxendevicemodel: Provide xendevicemodel_pin_memory_cacheattr
Date: Tue, 23 Jan 2018 15:22:45 +0000 [thread overview]
Message-ID: <20180123152246.22031-6-ross.lagerwall@citrix.com> (raw)
In-Reply-To: <20180123152246.22031-1-ross.lagerwall@citrix.com>
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 | 19 +++++++++++++++++++
tools/libs/devicemodel/include/xendevicemodel.h | 14 ++++++++++++++
tools/libs/devicemodel/libxendevicemodel.map | 1 +
3 files changed, 34 insertions(+)
diff --git a/tools/libs/devicemodel/core.c b/tools/libs/devicemodel/core.c
index 4ae15e1..23924e9 100644
--- a/tools/libs/devicemodel/core.c
+++ b/tools/libs/devicemodel/core.c
@@ -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);
diff --git a/tools/libs/devicemodel/include/xendevicemodel.h b/tools/libs/devicemodel/include/xendevicemodel.h
index e5e047e..9b89f32 100644
--- a/tools/libs/devicemodel/include/xendevicemodel.h
+++ b/tools/libs/devicemodel/include/xendevicemodel.h
@@ -340,6 +340,20 @@ int xendevicemodel_relocate_memory(
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.
*
diff --git a/tools/libs/devicemodel/libxendevicemodel.map b/tools/libs/devicemodel/libxendevicemodel.map
index 4c967b3..04797b2 100644
--- a/tools/libs/devicemodel/libxendevicemodel.map
+++ b/tools/libs/devicemodel/libxendevicemodel.map
@@ -31,4 +31,5 @@ VERS_1.1 {
VERS_1.2 {
global:
xendevicemodel_relocate_memory;
+ xendevicemodel_pin_memory_cacheattr;
} VERS_1.1;
--
2.9.5
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-01-23 15:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-23 15:22 [PATCH v4 0/6] Add dmops to allow use of VGA with restricted QEMU Ross Lagerwall
2018-01-23 15:22 ` [PATCH v4 1/6] xen/mm: Make xenmem_add_to_physmap global Ross Lagerwall
2018-01-23 15:49 ` Wei Liu
2018-01-23 15:22 ` [PATCH v4 2/6] x86/hvm: Provide XEN_DMOP_relocate_memory Ross Lagerwall
2018-01-24 8:09 ` Jan Beulich
2018-01-24 9:20 ` Paul Durrant
2018-01-23 15:22 ` [PATCH v4 3/6] x86/hvm: Provide XEN_DMOP_pin_memory_cacheattr Ross Lagerwall
2018-01-23 15:22 ` [PATCH v4 4/6] tools: libxendevicemodel: Provide xendevicemodel_relocate_memory Ross Lagerwall
2018-01-23 15:22 ` Ross Lagerwall [this message]
2018-01-23 15:22 ` [PATCH v4 6/6] x86/domctl: Remove XEN_DOMCTL_pin_mem_cacheattr Ross Lagerwall
2018-01-23 15:44 ` Wei Liu
2018-01-23 15:47 ` Ross Lagerwall
2018-01-23 15:49 ` Wei Liu
2018-01-23 17:16 ` Jan Beulich
2018-01-23 17:49 ` Wei Liu
2018-01-24 8:00 ` Jan Beulich
2018-03-05 14:40 ` [PATCH v4 0/6] Add dmops to allow use of VGA with restricted QEMU Anthony PERARD
2018-03-05 15:13 ` Ross Lagerwall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180123152246.22031-6-ross.lagerwall@citrix.com \
--to=ross.lagerwall@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).