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

Re: [XEN PATCH v7 17/20] xen/arm: ffa: add ABI structs for sharing memory


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 3 Mar 2023 14:19:49 +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=I/nfgQNE5RWrj8gL81hvAMn6diiT/LRPKm+I969EdfU=; b=I1zsHZbwBH481l68OBGmUHCXq6927IkWH1IUEq89gC56WEMUptY99RCdPfA4fIXu6aUMU4rR/HjC19+to5+Pa7puAE4T0yT/u9q2nqg8GGPgT2y2/2BDXgsDQgOqtp+wsLrE1Q2QEFb57n5xVOdbOs1EheWSEfOV2q8IkXDd22LfBTGTpo+J8OpE42U1R35d4JwLt5UKv2gH8Yaq7cO+2i584IIs8Ej5KqQYQzSFoALx9p/VLqX3G18n4PBZWNxq+p/aSagpkzfs3E64nFzFePrXB3o7gNtr0i8IeUT1hvbAQaWkccbwxn9kMcwsnKcJfW6iDKi7GVaq7WIaYzHHaw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V13RQ9oBlXQTbS5QOZZFweUTCRXwoPjXC00t0nVNSwmE5WPr3RAeDJ25wdQ2bm7jmol38fjvA6vdBCH78F+w655kpL1YZje00P3AfMj1EAfbnCm3fhPbi9k7whsF8pSBLfzgpCvlCon634z8WMOkicrhvSb18eXmirGp+vCVmZck9tStv5rU59zV+qxQQz/oOMkA6lG3Lavtl7s82yd9ONFi+GPYMLKP+De/SPg++f0tGlo1IdEbSGijagrvD1WS/C74jtLKwQqx+4wgWBkB0BScII2gdK0SOfykqHDbc+qufj8B4Ea4Yij6Bsf67uvbjSFpkcs7ThsG061LBG676w==
  • 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>, Marc Bonnici <Marc.Bonnici@xxxxxxx>, Achin Gupta <Achin.Gupta@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 03 Mar 2023 14:20:18 +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: AQHZRtMeHT5ldak5gkyWq0YjrVZrQ67pKLkA
  • Thread-topic: [XEN PATCH v7 17/20] xen/arm: ffa: add ABI structs for sharing memory

Hi Jens,

> On 22 Feb 2023, at 16:33, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
> 
> Adds the ABI structs used by function FFA_MEM_SHARE and friends for
> sharing memory.
> 
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>

All the structures are coherent with the spec.

Just one small question after but independent if you choose or not to change 
the names:
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 74 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 74 insertions(+)
> 
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index bfd378f7fcd7..94c90b252454 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -197,6 +197,11 @@
> #define FFA_MSG_SEND                    0x8400006EU
> #define FFA_MSG_POLL                    0x8400006AU
> 
> +/*
> + * Structs below ending with _1_0 are defined in FF-A-1.0-REL and
> + * struct ending with _1_1 are defined in FF-A-1.1-REL0.
> + */
> +
> /* Partition information descriptor */
> struct ffa_partition_info_1_0 {
>     uint16_t id;
> @@ -211,6 +216,75 @@ struct ffa_partition_info_1_1 {
>     uint8_t uuid[16];
> };
> 
> +/* Constituent memory region descriptor */
> +struct ffa_address_range {
> +    uint64_t address;
> +    uint32_t page_count;
> +    uint32_t reserved;
> +};
> +
> +/* Composite memory region descriptor */
> +struct ffa_mem_region {
> +    uint32_t total_page_count;
> +    uint32_t address_range_count;
> +    uint64_t reserved;
> +    struct ffa_address_range address_range_array[];
> +};
> +
> +/* Memory access permissions descriptor */
> +struct ffa_mem_access_perm {
> +    uint16_t endpoint_id;
> +    uint8_t perm;
> +    uint8_t flags;
> +};
> +
> +/* Endpoint memory access descriptor */
> +struct ffa_mem_access {
> +    struct ffa_mem_access_perm access_perm;
> +    uint32_t region_offs;
> +    uint64_t reserved;
> +};
> +
> +/* Lend, donate or share memory transaction descriptor */
> +struct ffa_mem_transaction_1_0 {
> +    uint16_t sender_id;
> +    uint8_t mem_reg_attr;
> +    uint8_t reserved0;
> +    uint32_t flags;
> +    uint64_t global_handle;

Why global ? spec is just saying handle.

> +    uint64_t tag;
> +    uint32_t reserved1;
> +    uint32_t mem_access_count;
> +    struct ffa_mem_access mem_access_array[];
> +};
> +
> +struct ffa_mem_transaction_1_1 {
> +    uint16_t sender_id;
> +    uint16_t mem_reg_attr;
> +    uint32_t flags;
> +    uint64_t global_handle;

Same here

> +    uint64_t tag;
> +    uint32_t mem_access_size;
> +    uint32_t mem_access_count;
> +    uint32_t mem_access_offs;
> +    uint8_t reserved[12];
> +};
> +
> +/* Endpoint RX/TX descriptor */
> +struct ffa_endpoint_rxtx_descriptor_1_0 {
> +    uint16_t sender_id;
> +    uint16_t reserved;
> +    uint32_t rx_range_count;
> +    uint32_t tx_range_count;
> +};
> +
> +struct ffa_endpoint_rxtx_descriptor_1_1 {
> +    uint16_t sender_id;
> +    uint16_t reserved;
> +    uint32_t rx_region_offs;
> +    uint32_t tx_region_offs;
> +};
> +
> struct ffa_ctx {
>     void *rx;
>     const void *tx;
> -- 
> 2.34.1
> 




 


Rackspace

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