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

Re: [Xen-devel] [PATCH v2 13/13] lixl: arm: create optee firmware node in DT if tee=1



Hi,

On 03/09/18 17:54, Volodymyr Babchuk wrote:
If TEE support is enabled with "tee=1" option in xl.cfg,
then we need to inform guest about available TEE.

Currently only OP-TEE is supported, so we'll create DT
node in a way that is expected by optee driver in linux.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
  tools/libxl/libxl_arm.c | 29 +++++++++++++++++++++++++++++
  1 file changed, 29 insertions(+)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 7f1d509..6376239 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -407,6 +407,32 @@ static int make_psci_node(libxl__gc *gc, void *fdt)
      return 0;
  }
+static int make_optee_node(libxl__gc *gc, void *fdt)
+{
+    int res;
+    LOG(DEBUG, "Creating OP-TEE node in dtb");
+
+    res = fdt_begin_node(fdt, "firmware");
+    if (res) return res;
+
+    res = fdt_begin_node(fdt, "optee");
+    if (res) return res;
+
+    res = fdt_property_compat(gc, fdt, 1, "linaro,optee-tz");
+    if (res) return res;
+
+    res = fdt_property_string(fdt, "method", "smc");

We want the guest to use HVC interface not SMC.

+    if (res) return res;
+
+    res = fdt_end_node(fdt);
+    if (res) return res;
+
+    res = fdt_end_node(fdt);
+    if (res) return res;
+
+    return 0;
+}
+
  static int make_memory_nodes(libxl__gc *gc, void *fdt,
                               const struct xc_dom_image *dom)
  {
@@ -920,6 +946,9 @@ next_resize:
          if (info->arch_arm.vuart == LIBXL_VUART_TYPE_SBSA_UART)
              FDT( make_vpl011_uart_node(gc, fdt, ainfo, dom) );
+ if (libxl_defbool_val(info->tee))
+            FDT( make_optee_node(gc, fdt));

Space missing before the last ).

+
          if (pfdt)
              FDT( copy_partial_fdt(gc, fdt, pfdt) );

Cheers,

--
Julien Grall

_______________________________________________
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®.