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

Re: [XEN PATCH 6/6] xen/arm: ffa: support FFA_FEATURES


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 27 Mar 2024 13:45:55 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=NDG0K3cgENatIapr0eAsKQubWrXFg9yWBgRx6h7r57Q=; b=iSbXB/FB2Vzn2iwIEq5M5uIfDNMGR0q7rvHI337Kc39Ol+j3Qx0Q2LIa2FT51pOHFd8CnIKo2ayt+KDcrLUHXkGaaAQh9mV42LXQIkeVYh1eUnkh/msk3YpAd5LU4oDDgB9/1ESnbA6J3VUZKD50h5nxmMP3lVj/Q8hGbqFAI4QqgfxjoZ6NqQ/GedfbuvixtyyOvd+R8I2TNlSFzZVbkV+0qbcvt7DuSbPAubmclWSHEAS0PQQHiBGshAHU7JBZaUjboS7GmPZu9EZKlYycyQfxy715MIfiWw0PdNcKp7TkkuLoa8eHSGYk/LrhVW4w+Jc9HZMSlZ6nVfvgJg4seA==
  • 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=NDG0K3cgENatIapr0eAsKQubWrXFg9yWBgRx6h7r57Q=; b=m6rYYnoO11DjR/qEPrx3/VTqHFKlobq/HVpLjiz2VAEgy6Ho8aFbuF4RQQD587ZCVmg2VBNPmRpSzwxMmXLWFd2JiV8Sh8OHfKKw8rNSlZP3TuO8M4T08g/Up9tg74HXjaSCy75DycWoF0BJeDqTN+IUUBjMq1OqWw3jlY73vXVmcUwd8EbDtRyqM10Y2q/bW6YTfkXvh6JyOPfIbE7uK+QTfsm0hto3qWBmDUXa248TTPJsiL29f3w9vYzWvujxfbMpwe5Kje7dlwRh22uaeWwFU77AuR0VgvVWpzXbMmml9qSDLg16d4d7LH5MWXtMsvJFPfTbq+oO85jcdjjGUQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ifTCWZSTTBPd8sJAKpCzY8aMXYTX9MIW8o+OnYf6yRnrtI3YFausOmcgC0Tb5SrqN4P6xZxfasoK9VQvQ1DNRNrX+tuMAOhgfEidN+B7RG1Qa83O9BKNjE5UOnhyGNV5nEbiw2o78MCpHylhdAU9YqZRxzuTMGEzTdUKz0xvcraNQqI2oJas4nTVCsWJ1dPdK70qBp4DJdbRLCVHmxet+x0THZJCvw81VQ4iSJ32eRijz3AKHU5Z7fF0A3v4B/NRcYUTACJZqBHwGUEvApCdLBgEYLShmFxZBJa4/Y0uu6h8mT3ZpNDpfP15qLgp0btL+6oNlyhiixtdaUpFW3aiTw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C4RKJV3fqFh3nIU4NMcdxU0N1Jmwr4lDxNV2zN3r3tSl21VYpOuHA+J3YzC7J5c5MyYXLU5qHz3rPePKLQjTvElfhmM4MLLGMWAlFWFIcwu9hTOCyMc0JuM4YYQpP+U0wDch6Cz0GEnJhhWi68huTLIuFyG4FvQ5skuNgW69HkjL2epOaOv7wH0A6EMqYt2T0eGQH1Bz1IRpsGpyzW0eU7AS82r6pOtBecMLpoA7lXy/peI4JSLnemSQUNxoVJcawitgEO2+JTP7f5OQzMDFySGyqsE07XRzFPnZMG4APOji3LRHIhQA2CCeKZ+69DcPW5ndnF9O2rQZdY4BYyisPw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "patches@xxxxxxxxxx" <patches@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 27 Mar 2024 13:46:13 +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: AQHafphUyax1RiAti0Sh0JOrQKKl8bFLnPGA
  • Thread-topic: [XEN PATCH 6/6] xen/arm: ffa: support FFA_FEATURES

Hi Jens,

> On 25 Mar 2024, at 10:39, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
> 
> Add support for the mandatory FF-A ABI function FFA_FEATURES.
> 
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>

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

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 57 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 57 insertions(+)
> 
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index 4f7775b8c890..8665201e34a9 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -192,6 +192,60 @@ out:
>                  resp.a7 & mask);
> }
> 
> +static void handle_features(struct cpu_user_regs *regs)
> +{
> +    uint32_t a1 = get_user_reg(regs, 1);
> +    unsigned int n;
> +
> +    for ( n = 2; n <= 7; n++ )
> +    {
> +        if ( get_user_reg(regs, n) )
> +        {
> +            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
> +            return;
> +        }
> +    }
> +
> +    switch ( a1 )
> +    {
> +    case FFA_ERROR:
> +    case FFA_VERSION:
> +    case FFA_SUCCESS_32:
> +    case FFA_SUCCESS_64:
> +    case FFA_FEATURES:
> +    case FFA_ID_GET:
> +    case FFA_RX_RELEASE:
> +    case FFA_RXTX_UNMAP:
> +    case FFA_MEM_RECLAIM:
> +    case FFA_PARTITION_INFO_GET:
> +    case FFA_MSG_SEND_DIRECT_REQ_32:
> +    case FFA_MSG_SEND_DIRECT_REQ_64:
> +        ffa_set_regs_success(regs, 0, 0);
> +        break;
> +    case FFA_MEM_SHARE_64:
> +    case FFA_MEM_SHARE_32:
> +        /*
> +         * We currently don't support dynamically allocated buffers. Report
> +         * that with 0 in bit[0] of w2.
> +         */
> +        ffa_set_regs_success(regs, 0, 0);
> +        break;
> +    case FFA_RXTX_MAP_64:
> +    case FFA_RXTX_MAP_32:
> +        /*
> +         * We currently support 4k pages only, report that as 00 in
> +         * bit[0:1] in w0. This needs to be revised if Xen page size
> +         * differs from FFA_PAGE_SIZE (SZ_4K).
> +         */
> +        BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE);
> +        ffa_set_regs_success(regs, 0, 0);
> +        break;
> +    default:
> +        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
> +        break;
> +    }
> +}
> +
> static bool ffa_handle_call(struct cpu_user_regs *regs)
> {
>     uint32_t fid = get_user_reg(regs, 0);
> @@ -212,6 +266,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
>     case FFA_ID_GET:
>         ffa_set_regs_success(regs, ffa_get_vm_id(d), 0);
>         return true;
> +    case FFA_FEATURES:
> +        handle_features(regs);
> +        return true;
>     case FFA_RXTX_MAP_32:
>     case FFA_RXTX_MAP_64:
>         e = ffa_handle_rxtx_map(fid, get_user_reg(regs, 1),
> -- 
> 2.34.1
> 




 


Rackspace

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