[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 11/13] libxc: add xc_dom_tee_enable(...) function



This function uses XEN_DOMCTL_tee_op domctl to enable TEE
support for a given domain.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
 tools/libxc/include/xenctrl.h |  7 +++++++
 tools/libxc/xc_domain.c       | 13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index c626984..f768528 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -915,6 +915,13 @@ int xc_dom_vuart_init(xc_interface *xch,
                       evtchn_port_t *evtchn);
 
 /**
+ * This function enables TEE access for a given domain.
+ * @parm xch a handle to an open hypervisor interface
+ * @parm domid for which TEE should be enabled
+ */
+int xc_dom_tee_enable(xc_interface *xch, uint32_t domid);
+
+/**
  * This function returns information about the XSAVE state of a particular
  * vcpu of a domain. If extstate->size and extstate->xfeature_mask are 0,
  * the call is considered a query to retrieve them and the buffer is not
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index f5dfadd..800bb0f 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -348,6 +348,19 @@ int xc_dom_vuart_init(xc_interface *xch,
     return rc;
 }
 
+int xc_dom_tee_enable(xc_interface *xch, uint32_t domid)
+{
+    DECLARE_DOMCTL;
+
+    memset(&domctl, 0, sizeof(domctl));
+
+    domctl.cmd = XEN_DOMCTL_tee_op;
+    domctl.domain = domid;
+    domctl.u.tee_op.cmd = XEN_DOMCTL_TEE_OP_ENABLE;
+
+    return do_domctl(xch, &domctl);
+}
+
 int xc_domain_getinfo(xc_interface *xch,
                       uint32_t first_domid,
                       unsigned int max_doms,
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.