[XEN PATCH v7 03/20] tools: add Arm FF-A mediator

Jens Wiklander posted 20 patches 2 years, 11 months ago
There is a newer version of this series
[XEN PATCH v7 03/20] tools: add Arm FF-A mediator
Posted by Jens Wiklander 2 years, 11 months ago
Adds a new "ffa" value to the Enumeration "tee_type" to indicate if a
guest is trusted to use FF-A.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 tools/libs/light/libxl_arm.c     | 3 +++
 tools/libs/light/libxl_types.idl | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index ddc7b2a15975..601890dda1ce 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -205,6 +205,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     case LIBXL_TEE_TYPE_OPTEE:
         config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
         break;
+    case LIBXL_TEE_TYPE_FFA:
+        config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_FFA;
+        break;
     default:
         LOG(ERROR, "Unknown TEE type %d",
             d_config->b_info.tee);
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 0cfad8508dbd..64fb570bc19a 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -494,7 +494,8 @@ libxl_gic_version = Enumeration("gic_version", [
 
 libxl_tee_type = Enumeration("tee_type", [
     (0, "none"),
-    (1, "optee")
+    (1, "optee"),
+    (2, "ffa")
     ], init_val = "LIBXL_TEE_TYPE_NONE")
 
 libxl_rdm_reserve = Struct("rdm_reserve", [
-- 
2.34.1
Re: [XEN PATCH v7 03/20] tools: add Arm FF-A mediator
Posted by Anthony PERARD 2 years, 11 months ago
On Wed, Feb 22, 2023 at 04:33:00PM +0100, Jens Wiklander wrote:
> diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
> index 0cfad8508dbd..64fb570bc19a 100644
> --- a/tools/libs/light/libxl_types.idl
> +++ b/tools/libs/light/libxl_types.idl
> @@ -494,7 +494,8 @@ libxl_gic_version = Enumeration("gic_version", [
>  
>  libxl_tee_type = Enumeration("tee_type", [
>      (0, "none"),
> -    (1, "optee")
> +    (1, "optee"),
> +    (2, "ffa")

Could you add a comma at the end of this line? This will avoid the need
to change two lines the next time we are adding a tee_type (like you
have to do now).

Also, as you are changing libxl's API, could you add a LIBXL_HAVE_*
macro in libxl.h? Something like:
    /*
     * arch_arm.tee field in libxl_domain_build_info has ffa value.
     */
    #define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA 1

Thanks,

-- 
Anthony PERARD
Re: [XEN PATCH v7 03/20] tools: add Arm FF-A mediator
Posted by Jens Wiklander 2 years, 11 months ago
On Thu, Feb 23, 2023 at 5:50 PM Anthony PERARD
<anthony.perard@citrix.com> wrote:
>
> On Wed, Feb 22, 2023 at 04:33:00PM +0100, Jens Wiklander wrote:
> > diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
> > index 0cfad8508dbd..64fb570bc19a 100644
> > --- a/tools/libs/light/libxl_types.idl
> > +++ b/tools/libs/light/libxl_types.idl
> > @@ -494,7 +494,8 @@ libxl_gic_version = Enumeration("gic_version", [
> >
> >  libxl_tee_type = Enumeration("tee_type", [
> >      (0, "none"),
> > -    (1, "optee")
> > +    (1, "optee"),
> > +    (2, "ffa")
>
> Could you add a comma at the end of this line? This will avoid the need
> to change two lines the next time we are adding a tee_type (like you
> have to do now).
>
> Also, as you are changing libxl's API, could you add a LIBXL_HAVE_*
> macro in libxl.h? Something like:
>     /*
>      * arch_arm.tee field in libxl_domain_build_info has ffa value.
>      */
>     #define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA 1

OK, I'll fix that.

Thanks,
Jens

>
> Thanks,
>
> --
> Anthony PERARD
Re: [XEN PATCH v7 03/20] tools: add Arm FF-A mediator
Posted by Bertrand Marquis 2 years, 11 months ago
Hi Jens,

> On 22 Feb 2023, at 16:33, Jens Wiklander <jens.wiklander@linaro.org> wrote:
> 
> Adds a new "ffa" value to the Enumeration "tee_type" to indicate if a
> guest is trusted to use FF-A.
> 
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> tools/libs/light/libxl_arm.c     | 3 +++
> tools/libs/light/libxl_types.idl | 3 ++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
> index ddc7b2a15975..601890dda1ce 100644
> --- a/tools/libs/light/libxl_arm.c
> +++ b/tools/libs/light/libxl_arm.c
> @@ -205,6 +205,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
>     case LIBXL_TEE_TYPE_OPTEE:
>         config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
>         break;
> +    case LIBXL_TEE_TYPE_FFA:
> +        config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_FFA;
> +        break;
>     default:
>         LOG(ERROR, "Unknown TEE type %d",
>             d_config->b_info.tee);
> diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
> index 0cfad8508dbd..64fb570bc19a 100644
> --- a/tools/libs/light/libxl_types.idl
> +++ b/tools/libs/light/libxl_types.idl
> @@ -494,7 +494,8 @@ libxl_gic_version = Enumeration("gic_version", [
> 
> libxl_tee_type = Enumeration("tee_type", [
>     (0, "none"),
> -    (1, "optee")
> +    (1, "optee"),
> +    (2, "ffa")
>     ], init_val = "LIBXL_TEE_TYPE_NONE")
> 
> libxl_rdm_reserve = Struct("rdm_reserve", [
> -- 
> 2.34.1
>