[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [XEN PATCH v8 09/22] xen/arm: ffa: add direct request support
- To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Thu, 13 Apr 2023 11:16:22 +0000
- Accept-language: zh-CN, 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=8bA0eVWBnPdXLQXkC9X3VWUJ+ot9sWzORV2Kx2lSobI=; b=LUkKrRWCmt/cCsQBfQJXwWqarRnb8nUjNVhEcHSoIVsPrbOSHd8XFcCFoR2j3TRRhxDhiaM7pd1qCZrYsLFwfY1qg6JGa2gjt1krcC9uVFLzSQHHYbUV77lwL8FpzzS37zBxapRSnU7pSK7EMT2ZRJHTS+AF8fZkMr/5RqmDFUIE/XPvEjtpyCckVw41B9tGIb0mXNJQDTZdoGtJHvK9gf2g1JmSo8Sx5EE0uNtPoPaLqiUKPIKZoFlidEUoV4OTb3s+iodK9RzsDX+Cg+pVvRuOV9J8RQ2WWptb0NkQpS1hzsxblNrL8EkOKDB80ayOi5LWChomUexJ6swcb0xbcw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tc6t2s1WPEAs37dKPda17MAHFqbgc00cS075TBex9EHlUtA0Rqm5zxHFkMuBqngwtwSNPdy0slE36sVd2vZRgaJGQ+POfGGFBL8oFRgx0FeEKsYfO+8/64CKiJNEMG+o4g2fnkXzmZQSVdA+Pn7KpmJsIHCIrDRNVp33EbZxR51dflDcVbuPywW24fvCXaobhZMqsbXYHOcWT/tVxMgWHzZWiHiksn520YVMpLETa6p8BkdbYPOeFhnd8ZKWVX1DAsJzUUX2Fnq0jszyb3MbrlsnZf8B7uDGnLeKH2ds7GY54X14ii2hPHO1WKM83yo/rnEfZdYzB0VP7shgR0j33g==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Marc Bonnici <Marc.Bonnici@xxxxxxx>, Achin Gupta <Achin.Gupta@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Delivery-date: Thu, 13 Apr 2023 11:16:56 +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: AQHZbdfc5IUuFaQpQE2OHTLbOE6lL68pFi8g
- Thread-topic: [XEN PATCH v8 09/22] xen/arm: ffa: add direct request support
Hi Jens,
> -----Original Message-----
> Subject: [XEN PATCH v8 09/22] xen/arm: ffa: add direct request support
>
> Adds support for sending a FF-A direct request. Checks that the SP also
> supports handling a 32-bit direct request. 64-bit direct requests are
> not used by the mediator itself so there is not need to check for that.
>
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> ---
> xen/arch/arm/tee/ffa.c | 112
> +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 112 insertions(+)
>
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index f129879c5b81..f2cce955d981 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -181,6 +181,56 @@ static bool ffa_get_version(uint32_t *vers)
> return true;
> }
>
> +static int32_t get_ffa_ret_code(const struct arm_smccc_1_2_regs *resp)
> +{
> + switch ( resp->a0 )
> + {
> + case FFA_ERROR:
> + if ( resp->a2 )
> + return resp->a2;
> + else
> + return FFA_RET_NOT_SUPPORTED;
> + case FFA_SUCCESS_32:
> + case FFA_SUCCESS_64:
> + return FFA_RET_OK;
> + default:
> + return FFA_RET_NOT_SUPPORTED;
> + }
> +}
> +
> +static int32_t ffa_simple_call(uint32_t fid, register_t a1, register_t a2,
> + register_t a3, register_t a4)
> +{
> + const struct arm_smccc_1_2_regs arg = {
> + .a0 = fid,
> + .a1 = a1,
> + .a2 = a2,
> + .a3 = a3,
> + .a4 = a4,
> + };
> + struct arm_smccc_1_2_regs resp;
> +
> + arm_smccc_1_2_smc(&arg, &resp);
> +
> + return get_ffa_ret_code(&resp);
> +}
> +
> +static int32_t ffa_features(uint32_t id)
> +{
> + return ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
> +}
> +
> +static bool check_mandatory_feature(uint32_t id)
> +{
> + int32_t ret = ffa_features(id);
> +
> + if (ret)
Coding style nit: You need spaces before and after "ret", i.e.
if ( ret )
With this fixed:
Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>
Kind regards,
Henry
|