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

Re: [PATCH v5 3/9] xen/arm: add a primitive FF-A mediator


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 24 Aug 2022 11:28:02 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IwrNcJmYDxM9OXJPJDeU2D+KtfWhHkER3BZrVbvjv2A=; b=RgBFIu6OQ/70cBIdWqzubvbzRlXbvV7Mhvx9S/xWGyFe+AflD7mH3eFaHpo3CsLVWiHiAlkEE5Nrt+uuuwtn+iySB3PZxqdrH+avA+xwr4vp59xyFRCGSF59BUfUyHo5XEv+4l2+arIe0oiY5ax4QMlnYmdNYcZVpclhvixlf9DGkT0zkRWQXoT4Wc2FRlWkg2pM/T15PuWTAUzwg2Qr1V9WVS88FqQ5HoWZoniylxqCTSEwaOKu4pCx6Z+4wHRoQRXn8p4sZ0jrvZ9WsGLI5Tiio+gUbMf7D92PBYJMaNyDO6eoxrMsOj6Oi3D7w5msluye3xb9A+uoFvg1CUojtg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hmqpe5JdivjqHPwbA85Aen88JVRjxXs9QzFsa8lzSEn4cDFAqrGKvB7BrGF5cVdYQvD5BoiD4aG7AH802d+31Gr2FUDb8427B3ovOFC9ONBBPGeTyzwO5yAG8uvx2S2SqAXoMugfUfXudPU/LVhTHjUE1F4TgPgMSKsjxVZLBNSbOnnnJ1YLHqlzTHWYOHKVjqFQBwPYa+p2kyqDVmn0Jup0lup4EAYlBjrei62cJ5p1YWDW96bZLJBftWCOXuvR0BllqHyeTdsp+JtinmKcO/ykuo1oe4fEKQ+kmeynX70F4qRieoPICBJk55vn9xTUDIvW15A65ZdxBgriMhaZpA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, <Bertrand.Marquis@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 24 Aug 2022 09:28:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jens,

On 18/08/2022 12:55, Jens Wiklander wrote:
> Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
> Partition in secure world.
> 
> This commit brings in only the parts needed to negotiate FF-A version
> number with guest and SPMC.
> 
> A guest configuration variable "ffa_enabled" is used to indicate if a guest
> is trusted to use FF-A.
> 
> This is loosely based on the TEE mediator framework and the OP-TEE
> mediator.
> 
> [1] https://developer.arm.com/documentation/den0077/latest
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> ---
>  SUPPORT.md                        |   7 +
>  docs/man/xl.cfg.5.pod.in          |  15 ++
>  tools/include/libxl.h             |   6 +
>  tools/libs/light/libxl_arm.c      |   3 +
>  tools/libs/light/libxl_types.idl  |   1 +
>  tools/xl/xl_parse.c               |   3 +
>  xen/arch/arm/Kconfig              |  11 +
>  xen/arch/arm/Makefile             |   1 +
>  xen/arch/arm/domain.c             |  10 +
>  xen/arch/arm/domain_build.c       |   1 +
>  xen/arch/arm/ffa.c                | 354 ++++++++++++++++++++++++++++++
>  xen/arch/arm/include/asm/domain.h |   4 +
>  xen/arch/arm/include/asm/ffa.h    |  71 ++++++
>  xen/arch/arm/vsmc.c               |  17 +-
>  xen/include/public/arch-arm.h     |   2 +
>  15 files changed, 503 insertions(+), 3 deletions(-)
>  create mode 100644 xen/arch/arm/ffa.c
>  create mode 100644 xen/arch/arm/include/asm/ffa.h
> 
> diff --git a/SUPPORT.md b/SUPPORT.md
> index 70e98964cbc0..215bb3c9043b 100644
> --- a/SUPPORT.md
> +++ b/SUPPORT.md
> @@ -785,6 +785,13 @@ that covers the DMA of the device to be passed through.
>  
>  No support for QEMU backends in a 16K or 64K domain.
>  
> +### ARM: Firmware Framework for Arm A-profile (FF-A) Mediator
> +
> +    Status, Arm64: Tech Preview
> +
> +There are still some code paths where a vCPU may hog a pCPU longer than
> +necessary. The FF-A mediator is not yet implemented for Arm32.
> +
>  ### ARM: Guest Device Tree support
>  
>      Status: Supported
> diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> index b98d1613987e..234c036aecb1 100644
> --- a/docs/man/xl.cfg.5.pod.in
> +++ b/docs/man/xl.cfg.5.pod.in
> @@ -1616,6 +1616,21 @@ This feature is a B<technology preview>.
>  
>  =back
>  
> +=item B<ffa_enabled=BOOLEAN>
Looking at other config options, we usually have <feature>=BOOLEAN (without 
_enabled), so
I would just stick to "ffa". This would require changes in other places 
accordingly.

> +
> +B<Arm only.> Allow a guest to communicate via FF-A with Secure Partitions
> +(SP), default false.
> +
> +Currently is only a small subset of the FF-A specification supported. Just
Should be:
"Currently only a small subset of the FF-A specification is supported"

> +enough to communicate with OP-TEE. In general all the basic things and
"basic things" sounds a bit ambiguous.

> diff --git a/tools/libs/light/libxl_types.idl 
> b/tools/libs/light/libxl_types.idl
> index 2a42da2f7d78..bf4544bef399 100644
> --- a/tools/libs/light/libxl_types.idl
> +++ b/tools/libs/light/libxl_types.idl
> @@ -646,6 +646,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
Applying this patch results in a failure here so you need to rebase it on top 
of latest status.

Also, FWICS (can be checked by the toolstack maintainers) you are missing the 
required
changes in:
 - tools/golang/xenlight/helpers.gen.go
 - tools/golang/xenlight/types.gen.go
 - tools/ocaml/libs/xc/xenctrl.ml
 - tools/ocaml/libs/xc/xenctrl.mli

~Michal



 


Rackspace

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