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

Re: [PATCH 1/4] xen/arm: ffa: Add start_index to VM partinfo helper


  • To: Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • From: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • Date: Mon, 2 Mar 2026 09:33:27 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UONVnuEsnDlLi6dga+MRvTcYSIUJ9EuC23412FVLdvc=; fh=wNLC6Hyb5Ukz/ErppBRQBwv8vwa/OMsdh6R8bnNsiPU=; b=Am1702s3E9WxxRxR0Y78H3fvbBhXMDyXFGZf77fia6fqg6WAjF+wM1JBN4i4QnZmB2 2Pz6fRb9E5jzCYwfLI2BP0lfacm4LgaUIi4BWFKm0K2724BA+1M1Ga6k1g6bK6ju9sSM LZFfe+pOzG2/S6lwK2MCgpAmC4zJt5t44u2WjlZmIsOAR7BzOAg0bPYjeAbyo10X6+jV wZPpvn1ATXpU+SGGxPmZ9DPQ7Y9H8YYvYwiBCONmwm1pj6cvnEU8YiS87H8pKjzMQwY6 gVlNg+K87xuMoj7fIEtinSQNu8JCEKwKlusmQf1+/HXaUAyGJBK4+paX7JRtVrJnI6S7 o8OA==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1772440421; cv=none; d=google.com; s=arc-20240605; b=IGzZ8CKTkRroaLTcKSe5z7N46teAIoQhXY8Q1tC4AmVB6idYF5E26rjMRNzC8yLOW3 v6gq10iudB9746fneQqS+a9+6NabPMCLolPCRalecIEKxFhwgC7nMyWuFLXFGUKZgw6w tiiA4F4KgkF5Ztq/EtcHa6aCsb1yWKek5goFGyiUTKIZKL3safc+DDTdY3E10X9Z5EUg FQDfom2aiCMtT0DTEamZb4Hj0c/xSPRy2PV0NRFzplZD4807mie3gkqDowf6LTAfS0vy lsA80FeImQ+StySOEAFOjqZhzDmDF0wyMNTR5Rq4i44XGZvSyXWopYnleIWkhvN4upAu fF8Q==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Mon, 02 Mar 2026 08:34:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Bertrand,

On Wed, Feb 25, 2026 at 11:02 AM Bertrand Marquis
<bertrand.marquis@xxxxxxx> wrote:
>
> Windowed GET_REGS retrieval needs to emit VM entries starting from an
> arbitrary index, but ffa_get_vm_partinfo() always starts from index 0.
>
> Add a start_index parameter to ffa_get_vm_partinfo() and skip entries
> until the local index reaches start_index. Update
> ffa_handle_partition_info_get() to pass start_index=0 to preserve
> existing behavior.
>
> No functional changes.
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> ---
>  xen/arch/arm/tee/ffa_partinfo.c | 61 +++++++++++++++++++--------------
>  1 file changed, 35 insertions(+), 26 deletions(-)

Looks good:
Reviewed-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>

Cheers,
Jens

>
> diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
> index fdb03dae9a0c..6a6f3ffb822e 100644
> --- a/xen/arch/arm/tee/ffa_partinfo.c
> +++ b/xen/arch/arm/tee/ffa_partinfo.c
> @@ -167,14 +167,15 @@ out:
>      return ret;
>  }
>
> -static int32_t ffa_get_vm_partinfo(struct ffa_uuid uuid, uint32_t *vm_count,
> -                                   void **dst_buf, void *end_buf,
> -                                   uint32_t dst_size)
> +static int32_t ffa_get_vm_partinfo(struct ffa_uuid uuid, uint32_t 
> start_index,
> +                                   uint32_t *vm_count, void **dst_buf,
> +                                   void *end_buf, uint32_t dst_size)
>  {
>      struct domain *d = current->domain;
>      struct ffa_ctx *curr_ctx = d->arch.tee;
>      struct ffa_ctx *dest_ctx;
>      uint32_t count = 0;
> +    uint32_t idx = 0;
>      int32_t ret = FFA_RET_OK;
>      /*
>       * We do not have UUID info for VMs so use the 1.0 structure so that we 
> set
> @@ -202,17 +203,21 @@ static int32_t ffa_get_vm_partinfo(struct ffa_uuid 
> uuid, uint32_t *vm_count,
>      if ( ACCESS_ONCE(curr_ctx->guest_vers) >= FFA_VERSION_1_2 )
>      {
>          /* Add caller VM information */
> -        info.id = curr_ctx->ffa_id;
> -        info.execution_context = curr_ctx->num_vcpus;
> -        info.partition_properties = FFA_PART_VM_PROP;
> -        if ( is_64bit_domain(d) )
> -            info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
> -
> -        ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size, sizeof(info));
> -        if ( ret )
> -            return ret;
> +        if ( start_index == 0)
> +        {
> +            info.id = curr_ctx->ffa_id;
> +            info.execution_context = curr_ctx->num_vcpus;
> +            info.partition_properties = FFA_PART_VM_PROP;
> +            if ( is_64bit_domain(d) )
> +                info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
>
> -        count++;
> +            ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size,
> +                                sizeof(info));
> +            if ( ret )
> +                return ret;
> +            count++;
> +        }
> +        idx++;
>      }
>
>      if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
> @@ -231,21 +236,25 @@ static int32_t ffa_get_vm_partinfo(struct ffa_uuid 
> uuid, uint32_t *vm_count,
>              if ( dest_ctx == curr_ctx )
>                  continue;
>
> -            info.id = dest_ctx->ffa_id;
> -            info.execution_context = dest_ctx->num_vcpus;
> -            info.partition_properties = FFA_PART_VM_PROP;
> -            if ( dest_ctx->is_64bit )
> -                info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
> -
> -            ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size,
> -                                sizeof(info));
> -            if ( ret )
> +            if ( idx >= start_index )
>              {
> -                read_unlock(&ffa_ctx_list_rwlock);
> -                return ret;
> +                info.id = dest_ctx->ffa_id;
> +                info.execution_context = dest_ctx->num_vcpus;
> +                info.partition_properties = FFA_PART_VM_PROP;
> +                if ( dest_ctx->is_64bit )
> +                    info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
> +
> +                ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size,
> +                                    sizeof(info));
> +                if ( ret )
> +                {
> +                    read_unlock(&ffa_ctx_list_rwlock);
> +                    return ret;
> +                }
> +                count++;
>              }
>
> -            count++;
> +            idx++;
>          }
>          read_unlock(&ffa_ctx_list_rwlock);
>      }
> @@ -355,7 +364,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs 
> *regs)
>              goto out_rx_release;
>      }
>
> -    ret = ffa_get_vm_partinfo(uuid, &ffa_vm_count, &dst_buf, end_buf,
> +    ret = ffa_get_vm_partinfo(uuid, 0, &ffa_vm_count, &dst_buf, end_buf,
>                                dst_size);
>
>  out_rx_release:
> --
> 2.52.0
>



 


Rackspace

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