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

Re: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 21 Jul 2023 07:04:13 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; 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=n25+3Nh6lWSsuegEl7U23VehCU5dJJi/qzU5jDxHu6c=; b=diWUQDsjBhlACYmPp2vVAv96GYjhq0H/U9ySfjENOlNcU2XN/Mmy2hpBFrjQLyqte35Nb65ypBLnXPPyPzwYhMVOACj1V7d/VhdKYxX45JOeZSTXMAF8+NvdRLmfRWmfuLpCQzN05zOVMnLb+NFODc33axr+H4kI0hamBRcAPofMRKfvletE5YoMYYwhVdUwjCw1sFr0U6GMfd+a+u9ADcvpX8g94wN83nBonhzpyWAD8DfZiwYLLDFxpdVQDun2hgpjNcN73UHdFON1x7dpYjzKcERL/0PzD146bqvO5rnzxs6xXox3fuRi72Ngq+iJ7oYgrElXZeQmNfB+SuA90A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=InKHlQ0A/6gvD+8VV0nZdu66zlvtVGAK5fLGZ5F6oj10OnWRcwybz0H2xq/M9kvQ4KY5i4HpN0QyrFoxkRLW/rJ4QabNN6WxsiFsAWWspk/26k5YxMszOnsQZXMjEnjMASumzxPXgXdGH1wcZOodnXUqeGBnMftGM2+0PD5RuhCUfo4kRg7Hum8ZVR5p7qF/K6jHJGSpPFeDUvTB/O8D/ZN8faB1LWfFcOjQx60FYx/M/LU/fqktKFdpZT4cWKWpZD4I3abinQsLENEmav8Mk0nciCQ4nx8tstFCwxTWtsXwWLHZeGFxLVqszr0d32Pnj1dVpH6+rYeBSm2ILM0Ktw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jens Wiklander <jens.wiklander@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marc Bonnici <Marc.Bonnici@xxxxxxx>, Achin Gupta <Achin.Gupta@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 21 Jul 2023 07:05:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZuH9Qs/YHnqnvzkGuhUSzNiJMga/CdpeAgADLs4CAAI/HgA==
  • Thread-topic: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator

Hi Julien,

> On 21 Jul 2023, at 00:29, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> On 20/07/2023 11:20, Bertrand Marquis wrote:
>> Hi Jens,
>>> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@xxxxxxxxxx> 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.
>>> 
>>> [1] https://developer.arm.com/documentation/den0077/e
>>> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
>>> ---
>>> xen/arch/arm/include/asm/psci.h    |   4 +
>>> xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
>>> xen/arch/arm/tee/Kconfig           |  11 ++
>>> xen/arch/arm/tee/Makefile          |   1 +
>>> xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
>>> xen/arch/arm/vsmc.c                |  17 ++-
>>> xen/include/public/arch-arm.h      |   1 +
>>> 7 files changed, 291 insertions(+), 3 deletions(-)
>>> create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
>>> create mode 100644 xen/arch/arm/tee/ffa.c
>>> 
>>> diff --git a/xen/arch/arm/include/asm/psci.h 
>>> b/xen/arch/arm/include/asm/psci.h
>>> index 832f77afff3a..4780972621bb 100644
>>> --- a/xen/arch/arm/include/asm/psci.h
>>> +++ b/xen/arch/arm/include/asm/psci.h
>>> @@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
>>> void call_psci_system_off(void);
>>> void call_psci_system_reset(void);
>>> 
>>> +/* Range of allocated PSCI function numbers */
>>> +#define PSCI_FNUM_MIN_VALUE                 _AC(0,U)
>>> +#define PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
>>> +
>>> /* PSCI v0.2 interface */
>>> #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,           
>>>   \
>>>                                              ARM_SMCCC_CONV_32,             
>>>   \
>>> diff --git a/xen/arch/arm/include/asm/tee/ffa.h 
>>> b/xen/arch/arm/include/asm/tee/ffa.h
>>> new file mode 100644
>>> index 000000000000..44361a4e78e4
>>> --- /dev/null
>>> +++ b/xen/arch/arm/include/asm/tee/ffa.h
>>> @@ -0,0 +1,35 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +/*
>>> + * xen/arch/arm/include/asm/tee/ffa.h
>>> + *
>>> + * Arm Firmware Framework for ARMv8-A(FFA) mediator
>>> + *
>>> + * Copyright (C) 2023  Linaro Limited
>>> + */
>>> +
>>> +#ifndef __ASM_ARM_TEE_FFA_H__
>>> +#define __ASM_ARM_TEE_FFA_H__
>>> +
>>> +#include <xen/const.h>
>>> +#include <xen/kconfig.h>
> 
> None of the headers aside xen/config.h will include xen/kconfig.h. The former 
> is included everything from the compiler command line. So I have removed it.
> 
>>> +
>>> +#include <asm/smccc.h>
>>> +#include <asm/types.h>
>>> +
>>> +#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
>>> +#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
>>> +
>>> +static inline bool is_ffa_fid(uint32_t fid)
>>> +{
>>> +    uint32_t fn = fid & ARM_SMCCC_FUNC_MASK;
>>> +
>>> +    return fn >= FFA_FNUM_MIN_VALUE && fn <= FFA_FNUM_MAX_VALUE;
>>> +}
>>> +
>>> +#ifdef CONFIG_FFA
>>> +#define FFA_NR_FUNCS    12
>>> +#else
>>> +#define FFA_NR_FUNCS    0
>>> +#endif
>>> +
>>> +#endif /*__ASM_ARM_TEE_FFA_H__*/
>>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>>> index 392169b2559d..923f08ba8cb7 100644
>>> --- a/xen/arch/arm/tee/Kconfig
>>> +++ b/xen/arch/arm/tee/Kconfig
>>> @@ -8,3 +8,14 @@ config OPTEE
>>>  virtualization-enabled OP-TEE present. You can learn more
>>>  about virtualization for OP-TEE at
>>>  https://optee.readthedocs.io/architecture/virtualization.html
>>> +
>>> +config FFA
>>> + bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>> + default n
>>> + depends on ARM_64
>> Even if the tee Makefile is only included if CONFIG_TEE is activated,
>> the missing dependency on TEE here allows to select FFA without TEE
>> resulting in a config with FFA activated but not compiled in.
>> No build error is coming from this, FFA is just not in if selected without 
>> TEE.
>> Should be:
>> depends on ARM_64 && TEE
>> I am ok if this is fixed on commit and my R-B kept.
> 
> I have fixed it and committed up to patch #9. That said, I think it would be 
> best if we have a category TEE where both the OPTEE and FFA config is under. 
> This will help to make the menuconfig clearer and avoid the "depends TEE".

Thanks :-)

> 
> Bertrand, Jens, can one of you have a look?

The fact that both depend on TEE is making both of those appearing under TEE in 
Kconfig and in menuconfig as sub-items of TEE.

But i agree having a menu for those would be nicer and I will propose a patch 
for that later today.

Cheers
Bertrand




 


Rackspace

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