* [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg
2019-06-19 17:53 [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
@ 2019-06-19 17:54 ` Volodymyr Babchuk
2019-08-23 19:38 ` Volodymyr Babchuk
2019-09-18 10:35 ` Ian Jackson
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 2/5] tools/arm: optee: create optee firmware node in DT if tee=optee Volodymyr Babchuk
` (4 subsequent siblings)
5 siblings, 2 replies; 12+ messages in thread
From: Volodymyr Babchuk @ 2019-06-19 17:54 UTC (permalink / raw)
To: xen-devel; +Cc: tee-dev, Ian Jackson, Volodymyr Babchuk, Wei Liu
This enumeration controls TEE type for a domain. Currently there is
two possible options: either 'none' or 'optee'.
'none' is the default value and it basically disables TEE support at
all.
'optee' enables access to the OP-TEE running on a host machine. This
requires special OP-TEE build with virtualization support enabled.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
Changes from v6:
- Updated documentation according to Julien Grall's suggestions,
add link to OP-TEE documentation
Changes from v5:
- Replaced "native" with "optee" in the commit description.
- Updated and extended documentation based on Julien Grall's
and Ian Jackson's suggestions.
Changes from v4:
- "native" option was replaced with "optee"
- "tee" property was moved from arch-specific section to the
global one. Documentation moved inside "Devices" section.
Changes from v3:
- tee_enabled renamed to tee_type. Currently two types are supported
as described in the commit message
- Add LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE definition
Changes from v2:
- Use arch.tee_enabled instead of separate domctl
---
docs/man/xl.cfg.5.pod.in | 29 +++++++++++++++++++++++++++++
tools/libxl/libxl.h | 5 +++++
tools/libxl/libxl_arm.c | 13 +++++++++++++
tools/libxl/libxl_types.idl | 6 ++++++
tools/xl/xl_parse.c | 9 +++++++++
5 files changed, 62 insertions(+)
diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index c99d40307e..e71b3b411d 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -1544,6 +1544,35 @@ Set maximum height for pointer device.
=back
+=item B<tee="STRING">
+
+B<Arm only.> Set TEE type for the guest. TEE is a Trusted Execution
+Environment -- separate secure OS found on some platforms. B<STRING> can be one of the:
+
+=over 4
+
+=item B<none>
+
+"Don't allow the guest to use TEE if present on the platform. This is
+the default value.
+
+=item B<optee>
+
+Allow a guest to access the host OP-TEE OS. Xen will mediate the
+access to OP-TEE and the resource isolation will be provided directly
+by OP-TEE. OP-TEE itself may limit the number of guests that can
+concurrently use it. This requires a virtualization-aware OP-TEE for
+this to work.
+
+You can refer to
+L<OP-TEE documentation|https://optee.readthedocs.io/architecture/virtualization.html>
+for more information about how to enable and configure virtualization support
+in OP-TEE.
+
+This feature is a B<technology preview>.
+
+=back
+
=back
=head2 Paravirtualised (PV) Guest Specific Options
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 9bacfb97f0..1fe6ea2bd8 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -273,6 +273,11 @@
*/
#define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
+/*
+ * libxl_domain_build_info has the arch_arm.tee field.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 1
+
/*
* LIBXL_HAVE_SOFT_RESET indicates that libxl supports performing
* 'soft reset' for domains and there is 'soft_reset' shutdown reason
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 141e159043..6b72c00960 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -89,6 +89,19 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
return ERROR_FAIL;
}
+ switch (d_config->b_info.tee) {
+ case LIBXL_TEE_TYPE_NONE:
+ config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_NONE;
+ break;
+ case LIBXL_TEE_TYPE_OPTEE:
+ config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
+ break;
+ default:
+ LOG(ERROR, "Unknown TEE type %d",
+ d_config->b_info.tee);
+ return ERROR_FAIL;
+ }
+
return 0;
}
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index b61399ce36..fa5ee65463 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -460,6 +460,11 @@ libxl_gic_version = Enumeration("gic_version", [
(0x30, "v3")
], init_val = "LIBXL_GIC_VERSION_DEFAULT")
+libxl_tee_type = Enumeration("tee_type", [
+ (0, "none"),
+ (1, "optee")
+ ], init_val = "LIBXL_TEE_TYPE_NONE")
+
libxl_rdm_reserve = Struct("rdm_reserve", [
("strategy", libxl_rdm_reserve_strategy),
("policy", libxl_rdm_reserve_policy),
@@ -537,6 +542,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
("nested_hvm", libxl_defbool),
("apic", libxl_defbool),
("dm_restrict", libxl_defbool),
+ ("tee", libxl_tee_type),
("u", KeyedUnion(None, libxl_domain_type, "type",
[("hvm", Struct(None, [("firmware", string),
("bios", libxl_bios_type),
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index e105bda2bb..0604374ef3 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2691,6 +2691,15 @@ skip_usbdev:
}
}
+ if (!xlu_cfg_get_string (config, "tee", &buf, 1)) {
+ e = libxl_tee_type_from_string(buf, &b_info->tee);
+ if (e) {
+ fprintf(stderr,
+ "Unknown tee \"%s\" specified\n", buf);
+ exit(-ERROR_FAIL);
+ }
+ }
+
parse_vkb_list(config, d_config);
xlu_cfg_destroy(config);
--
2.21.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg Volodymyr Babchuk
@ 2019-08-23 19:38 ` Volodymyr Babchuk
2019-09-18 10:35 ` Ian Jackson
1 sibling, 0 replies; 12+ messages in thread
From: Volodymyr Babchuk @ 2019-08-23 19:38 UTC (permalink / raw)
To: Volodymyr Babchuk, Ian Jackson; +Cc: tee-dev, xen-devel, Ian Jackson, Wei Liu
Hello Ian,
Do you have a couple of minutes to check this and the following patches?
> This enumeration controls TEE type for a domain. Currently there is
> two possible options: either 'none' or 'optee'.
>
> 'none' is the default value and it basically disables TEE support at
> all.
>
> 'optee' enables access to the OP-TEE running on a host machine. This
> requires special OP-TEE build with virtualization support enabled.
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
>
> ---
>
> Changes from v6:
> - Updated documentation according to Julien Grall's suggestions,
> add link to OP-TEE documentation
>
> Changes from v5:
> - Replaced "native" with "optee" in the commit description.
> - Updated and extended documentation based on Julien Grall's
> and Ian Jackson's suggestions.
>
> Changes from v4:
> - "native" option was replaced with "optee"
> - "tee" property was moved from arch-specific section to the
> global one. Documentation moved inside "Devices" section.
>
> Changes from v3:
> - tee_enabled renamed to tee_type. Currently two types are supported
> as described in the commit message
> - Add LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE definition
>
> Changes from v2:
> - Use arch.tee_enabled instead of separate domctl
> ---
> docs/man/xl.cfg.5.pod.in | 29 +++++++++++++++++++++++++++++
> tools/libxl/libxl.h | 5 +++++
> tools/libxl/libxl_arm.c | 13 +++++++++++++
> tools/libxl/libxl_types.idl | 6 ++++++
> tools/xl/xl_parse.c | 9 +++++++++
> 5 files changed, 62 insertions(+)
>
> diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> index c99d40307e..e71b3b411d 100644
> --- a/docs/man/xl.cfg.5.pod.in
> +++ b/docs/man/xl.cfg.5.pod.in
> @@ -1544,6 +1544,35 @@ Set maximum height for pointer device.
>
> =back
>
> +=item B<tee="STRING">
> +
> +B<Arm only.> Set TEE type for the guest. TEE is a Trusted Execution
> +Environment -- separate secure OS found on some platforms. B<STRING> can be one of the:
> +
> +=over 4
> +
> +=item B<none>
> +
> +"Don't allow the guest to use TEE if present on the platform. This is
> +the default value.
> +
> +=item B<optee>
> +
> +Allow a guest to access the host OP-TEE OS. Xen will mediate the
> +access to OP-TEE and the resource isolation will be provided directly
> +by OP-TEE. OP-TEE itself may limit the number of guests that can
> +concurrently use it. This requires a virtualization-aware OP-TEE for
> +this to work.
> +
> +You can refer to
> +L<OP-TEE documentation|https://optee.readthedocs.io/architecture/virtualization.html>
> +for more information about how to enable and configure virtualization support
> +in OP-TEE.
> +
> +This feature is a B<technology preview>.
> +
> +=back
> +
> =back
>
> =head2 Paravirtualised (PV) Guest Specific Options
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 9bacfb97f0..1fe6ea2bd8 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -273,6 +273,11 @@
> */
> #define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
>
> +/*
> + * libxl_domain_build_info has the arch_arm.tee field.
> + */
> +#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 1
> +
> /*
> * LIBXL_HAVE_SOFT_RESET indicates that libxl supports performing
> * 'soft reset' for domains and there is 'soft_reset' shutdown reason
> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index 141e159043..6b72c00960 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -89,6 +89,19 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
> return ERROR_FAIL;
> }
>
> + switch (d_config->b_info.tee) {
> + case LIBXL_TEE_TYPE_NONE:
> + config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_NONE;
> + break;
> + case LIBXL_TEE_TYPE_OPTEE:
> + config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
> + break;
> + default:
> + LOG(ERROR, "Unknown TEE type %d",
> + d_config->b_info.tee);
> + return ERROR_FAIL;
> + }
> +
> return 0;
> }
>
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index b61399ce36..fa5ee65463 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -460,6 +460,11 @@ libxl_gic_version = Enumeration("gic_version", [
> (0x30, "v3")
> ], init_val = "LIBXL_GIC_VERSION_DEFAULT")
>
> +libxl_tee_type = Enumeration("tee_type", [
> + (0, "none"),
> + (1, "optee")
> + ], init_val = "LIBXL_TEE_TYPE_NONE")
> +
> libxl_rdm_reserve = Struct("rdm_reserve", [
> ("strategy", libxl_rdm_reserve_strategy),
> ("policy", libxl_rdm_reserve_policy),
> @@ -537,6 +542,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
> ("nested_hvm", libxl_defbool),
> ("apic", libxl_defbool),
> ("dm_restrict", libxl_defbool),
> + ("tee", libxl_tee_type),
> ("u", KeyedUnion(None, libxl_domain_type, "type",
> [("hvm", Struct(None, [("firmware", string),
> ("bios", libxl_bios_type),
> diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
> index e105bda2bb..0604374ef3 100644
> --- a/tools/xl/xl_parse.c
> +++ b/tools/xl/xl_parse.c
> @@ -2691,6 +2691,15 @@ skip_usbdev:
> }
> }
>
> + if (!xlu_cfg_get_string (config, "tee", &buf, 1)) {
> + e = libxl_tee_type_from_string(buf, &b_info->tee);
> + if (e) {
> + fprintf(stderr,
> + "Unknown tee \"%s\" specified\n", buf);
> + exit(-ERROR_FAIL);
> + }
> + }
> +
> parse_vkb_list(config, d_config);
>
> xlu_cfg_destroy(config);
--
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg Volodymyr Babchuk
2019-08-23 19:38 ` Volodymyr Babchuk
@ 2019-09-18 10:35 ` Ian Jackson
1 sibling, 0 replies; 12+ messages in thread
From: Ian Jackson @ 2019-09-18 10:35 UTC (permalink / raw)
To: Volodymyr Babchuk; +Cc: tee-dev, xen-devel, Wei Liu
Volodymyr Babchuk writes ("[PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg"):
> This enumeration controls TEE type for a domain. Currently there is
> two possible options: either 'none' or 'optee'.
>
> 'none' is the default value and it basically disables TEE support at
> all.
>
> 'optee' enables access to the OP-TEE running on a host machine. This
> requires special OP-TEE build with virtualization support enabled.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Xen-devel] [PATCH v7 2/5] tools/arm: optee: create optee firmware node in DT if tee=optee
2019-06-19 17:53 [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg Volodymyr Babchuk
@ 2019-06-19 17:54 ` Volodymyr Babchuk
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 3/5] xen/arm: tee: place OP-TEE Kconfig option right after TEE Volodymyr Babchuk
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Volodymyr Babchuk @ 2019-06-19 17:54 UTC (permalink / raw)
To: xen-devel; +Cc: tee-dev, Ian Jackson, Julien Grall, Volodymyr Babchuk, Wei Liu
If TEE support is enabled with "tee=optee" option in xl.cfg,
then we need to inform guest about available TEE, by creating
corresponding node in the guest's device tree.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
This patch depends on patches to optee.c.
Changes from v4:
- "native" option replaced with "optee"
Changes from v3:
- "smc" method replaced with "hvc"
- Coding style fixes
---
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 6b72c00960..bf31b9b3ca 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -420,6 +420,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", "hvc");
+ 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)
{
@@ -933,6 +959,9 @@ next_resize:
if (info->arch_arm.vuart == LIBXL_VUART_TYPE_SBSA_UART)
FDT( make_vpl011_uart_node(gc, fdt, ainfo, dom) );
+ if (info->tee == LIBXL_TEE_TYPE_OPTEE)
+ FDT( make_optee_node(gc, fdt) );
+
if (pfdt)
FDT( copy_partial_fdt(gc, fdt, pfdt) );
--
2.21.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Xen-devel] [PATCH v7 3/5] xen/arm: tee: place OP-TEE Kconfig option right after TEE
2019-06-19 17:53 [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 1/5] tools/arm: tee: add "tee" option for xl.cfg Volodymyr Babchuk
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 2/5] tools/arm: optee: create optee firmware node in DT if tee=optee Volodymyr Babchuk
@ 2019-06-19 17:54 ` Volodymyr Babchuk
2019-07-07 18:30 ` Julien Grall
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 4/5] xen/arm: optee: check if OP-TEE is virtualization-aware Volodymyr Babchuk
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Volodymyr Babchuk @ 2019-06-19 17:54 UTC (permalink / raw)
To: xen-devel; +Cc: tee-dev, Julien Grall, Stefano Stabellini, Volodymyr Babchuk
It is nicer, when options for particular TEE mediators (currently,
OP-TEE only) are following generic "Enable TEE mediators support"
option in the menuconfig:
[*] Enable TEE mediators support
[ ] Enable OP-TEE mediator
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
xen/arch/arm/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 04d399ffbf..c2db2a6953 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -113,6 +113,8 @@ config TEE
This option enables generic TEE mediators support. It allows guests
to access real TEE via one of TEE mediators implemented in XEN.
+source "arch/arm/tee/Kconfig"
+
endmenu
menu "ARM errata workaround via the alternative framework"
@@ -238,5 +240,3 @@ source "arch/arm/platforms/Kconfig"
source "common/Kconfig"
source "drivers/Kconfig"
-
-source "arch/arm/tee/Kconfig"
--
2.21.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Xen-devel] [PATCH v7 4/5] xen/arm: optee: check if OP-TEE is virtualization-aware
2019-06-19 17:53 [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
` (2 preceding siblings ...)
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 3/5] xen/arm: tee: place OP-TEE Kconfig option right after TEE Volodymyr Babchuk
@ 2019-06-19 17:54 ` Volodymyr Babchuk
2019-07-07 18:32 ` Julien Grall
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 5/5] xen/arm: optee: document OPTEE option in tee/Kconfig Volodymyr Babchuk
2019-09-18 13:59 ` [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Julien Grall
5 siblings, 1 reply; 12+ messages in thread
From: Volodymyr Babchuk @ 2019-06-19 17:54 UTC (permalink / raw)
To: xen-devel; +Cc: tee-dev, Julien Grall, Stefano Stabellini, Volodymyr Babchuk
This is workaround for OP-TEE 3.5. This is the first OP-TEE release
which supports virtualization, but there is no way to tell if
OP-TEE was built with that support enabled. We can probe for it
by calling SMC that is available only when OP-TEE is built with
virtualization support.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
xen/arch/arm/tee/optee.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 28d34360fc..14381d6b2d 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -172,6 +172,16 @@ static bool optee_probe(void)
return false;
}
+ /*
+ * Workaround: OP-TEE 3.5 have no way to tell if it is build with
+ * virtualization support. But we can probe for OPTEE_SMC_VM_DESTROYED
+ * call. It will return OPTEE_SMC_RETURN_UNKNOWN_FUNCTION if
+ * OP-TEE have no virtualization support enabled.
+ */
+ arm_smccc_smc(OPTEE_SMC_VM_DESTROYED, 0, 0, 0, 0, 0, 0, 0, &resp);
+ if ( resp.a0 == OPTEE_SMC_RETURN_UNKNOWN_FUNCTION )
+ return false;
+
return true;
}
--
2.21.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Xen-devel] [PATCH v7 4/5] xen/arm: optee: check if OP-TEE is virtualization-aware
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 4/5] xen/arm: optee: check if OP-TEE is virtualization-aware Volodymyr Babchuk
@ 2019-07-07 18:32 ` Julien Grall
0 siblings, 0 replies; 12+ messages in thread
From: Julien Grall @ 2019-07-07 18:32 UTC (permalink / raw)
To: Volodymyr Babchuk, xen-devel; +Cc: tee-dev, Stefano Stabellini
Hi Volodymyr,
On 6/19/19 6:54 PM, Volodymyr Babchuk wrote:
> This is workaround for OP-TEE 3.5. This is the first OP-TEE release
> which supports virtualization, but there is no way to tell if
> OP-TEE was built with that support enabled. We can probe for it
> by calling SMC that is available only when OP-TEE is built with
> virtualization support.
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Cheers,
> ---
> xen/arch/arm/tee/optee.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
> index 28d34360fc..14381d6b2d 100644
> --- a/xen/arch/arm/tee/optee.c
> +++ b/xen/arch/arm/tee/optee.c
> @@ -172,6 +172,16 @@ static bool optee_probe(void)
> return false;
> }
>
> + /*
> + * Workaround: OP-TEE 3.5 have no way to tell if it is build with
> + * virtualization support. But we can probe for OPTEE_SMC_VM_DESTROYED
> + * call. It will return OPTEE_SMC_RETURN_UNKNOWN_FUNCTION if
> + * OP-TEE have no virtualization support enabled.
> + */
> + arm_smccc_smc(OPTEE_SMC_VM_DESTROYED, 0, 0, 0, 0, 0, 0, 0, &resp);
> + if ( resp.a0 == OPTEE_SMC_RETURN_UNKNOWN_FUNCTION )
> + return false;
> +
> return true;
> }
>
>
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Xen-devel] [PATCH v7 5/5] xen/arm: optee: document OPTEE option in tee/Kconfig
2019-06-19 17:53 [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
` (3 preceding siblings ...)
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 4/5] xen/arm: optee: check if OP-TEE is virtualization-aware Volodymyr Babchuk
@ 2019-06-19 17:54 ` Volodymyr Babchuk
2019-07-07 18:33 ` Julien Grall
2019-09-18 13:59 ` [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Julien Grall
5 siblings, 1 reply; 12+ messages in thread
From: Volodymyr Babchuk @ 2019-06-19 17:54 UTC (permalink / raw)
To: xen-devel; +Cc: tee-dev, Julien Grall, Stefano Stabellini, Volodymyr Babchuk
Add basic information about the OP-TEE mediator and note about
dependency on virtualization-aware OP-TEE.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
xen/arch/arm/tee/Kconfig | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
index 5b829db2e9..b4b6aa2610 100644
--- a/xen/arch/arm/tee/Kconfig
+++ b/xen/arch/arm/tee/Kconfig
@@ -2,3 +2,8 @@ config OPTEE
bool "Enable OP-TEE mediator"
default n
depends on TEE
+ help
+ Enable experimental OP-TEE mediator. It allows guests to access
+ OP-TEE running on your platform. This requires virtualization-enabled
+ OP-TEE present. You can learn more about virtualization for OP-TEE
+ at https://optee.readthedocs.io/architecture/virtualization.html
--
2.21.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN
2019-06-19 17:53 [Xen-devel] [PATCH v7 0/5] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
` (4 preceding siblings ...)
2019-06-19 17:54 ` [Xen-devel] [PATCH v7 5/5] xen/arm: optee: document OPTEE option in tee/Kconfig Volodymyr Babchuk
@ 2019-09-18 13:59 ` Julien Grall
5 siblings, 0 replies; 12+ messages in thread
From: Julien Grall @ 2019-09-18 13:59 UTC (permalink / raw)
To: Volodymyr Babchuk, xen-devel
Cc: tee-dev, Stefano Stabellini, Ian Jackson, Wei Liu
Hi,
On 19/06/2019 18:53, Volodymyr Babchuk wrote:
> Volodymyr Babchuk (5):
> tools/arm: tee: add "tee" option for xl.cfg
> tools/arm: optee: create optee firmware node in DT if tee=optee
> xen/arm: tee: place OP-TEE Kconfig option right after TEE
> xen/arm: optee: check if OP-TEE is virtualization-aware
> xen/arm: optee: document OPTEE option in tee/Kconfig
This series is now fully committed. Thank you for the contribution!
Cheers,
>
> docs/man/xl.cfg.5.pod.in | 29 +++++++++++++++++++++++++
> tools/libxl/libxl.h | 5 +++++
> tools/libxl/libxl_arm.c | 42 +++++++++++++++++++++++++++++++++++++
> tools/libxl/libxl_types.idl | 6 ++++++
> tools/xl/xl_parse.c | 9 ++++++++
> xen/arch/arm/Kconfig | 4 ++--
> xen/arch/arm/tee/Kconfig | 5 +++++
> xen/arch/arm/tee/optee.c | 10 +++++++++
> 8 files changed, 108 insertions(+), 2 deletions(-)
>
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread