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

Re: [XEN PATCH v1 1/5] xen/arm: ffa: refactor ffa_handle_call()


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 10 Apr 2024 07:04:22 +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=oYc5+cJMbOtVGL7/jJFXnS9bVn/ilE+xcryFhm5I3rU=; b=cvPO1sgJjalSUNz/PD66DRIMfqOxcxo4seA1YEKLBuGhHm6RjLmul/XgsTCfkGuANs2MiU1QHDlbaKyWUrd9REmzeniUI9IhMlXED92WSKuLgJyg4eGzCykRE7+WW82ZTA74PwfmfVp0bx1IfOyzxPtBhOUpGS17+HUypfM0ZPt8uED98WTdgzrPrscHQPUwHdZlcDLC81DvRpbmYzSKsikO8VYr8BsfJQDqWVhhT1v3PaLjCjL4X+ec0cvo8kCN0NoE6eL9G0tZgk8jKyQjoswC3fC8p+3pAdkMiavTs4ERUlsGIR+2ZG6MKaJK7FIm/5OjLShUCbWfRR1XDGHVxw==
  • 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=oYc5+cJMbOtVGL7/jJFXnS9bVn/ilE+xcryFhm5I3rU=; b=lcJXGeM11tDA906V5oT119Ynsbohn2aZi4hD/7bg3VQyFIN9aRk5okUOnDB6nekdiyxpq3Ylk+db6UHyLgwAMeeGL/4crdDScSbFITdjp40wZUnVxWQfQhy41HrF7vh7KswwnP0kYMPubixhd/EeM/D3SNepJCP+80eq/FyF6g/1ChS1RzQXis4YQjDma3PIof/WdwRzEehTCDVtn+nP55JisF/3T5h51IYzCVI5h3YyeLPQwCqtlcy+X3exsvktLuyrUA5l47c96K2Mxo7fMj0V4ouk5wnGEfSrVXPC/9qKbzD/A04i5ZDLCAcsJ3ofbFbmbg7OnkQ17tPAEiEmjQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=PVWKp2i+CpvHKbJc1A36qnW0HXGEmVJDIsHiVNsXAXKMIRBkp28CADj292Y+anDYjQAELbMhLe2RgOCWvxd5F8XPBt6fBeoEu62+KgApFmbMfHNZL8Dk5JH9nI/JPx7tIJ/WCYhZ0wTwBGPC181k0xRSibo3XS54FIrzJ+i6HUnAfW2QqwsR3mtGgQBLLox98E2gQ+xYSxfc88SaTdTLeRcinRIfgXTU4A3rJwA6XIpyXnytEs2+glCbkJi3qXCjy0a1C7P1vCQycjnoG7cgr+q2flnxSVU+a8bz/IWfys/ozEYjAhwE4WW3xMKYwf4YewO7QN833+aRM+ghzLbrwQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5s8jbv1N47Vc2kvITyf5bZeKpuXP1hPjaVJ+AfBGXqK+LnoIx9XpzJgksObrtLcf24bXuARCpVu6qg7iVqkE7XtTrQm/3ydStLo2bzPnN6WNKaz7HQ8EJVFxNuPvbctA2SOzgIWXQDbGBadczYbYHygjbYD2GGVKPuLLrx8wH5QPonb5k0efHKLl+Piuwmqh81fJ5wYxFUR9vj9mDdqI+NNnWMoSN6Zux668CLYiVYzziT4nuqNgeO8H8OVyT9PRgkLYJiZD6GJg5gkvylAMNHs+4eQ6vIQgz0gJpHCUcavfki7nXhY5ISL5fj0W++Vr94Cdn1y8EnLfvQnwpW2tQ==
  • 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, 10 Apr 2024 07:04:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHaipO7gx2fHTq0t0aNBoE/iQWW9bFhFW0A
  • Thread-topic: [XEN PATCH v1 1/5] xen/arm: ffa: refactor ffa_handle_call()

Hi Jens,

> On 9 Apr 2024, at 17:36, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
> 
> Refactors the large switch block in ffa_handle_call() to use common code
> for the simple case where it's either an error code or success with no
> further parameters.
> 
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>

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

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 30 ++++++++++--------------------
> 1 file changed, 10 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index 8665201e34a9..5209612963e1 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -273,18 +273,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
>     case FFA_RXTX_MAP_64:
>         e = ffa_handle_rxtx_map(fid, get_user_reg(regs, 1),
> get_user_reg(regs, 2), get_user_reg(regs, 3));
> -        if ( e )
> -            ffa_set_regs_error(regs, e);
> -        else
> -            ffa_set_regs_success(regs, 0, 0);
> -        return true;
> +        break;
>     case FFA_RXTX_UNMAP:
>         e = ffa_handle_rxtx_unmap();
> -        if ( e )
> -            ffa_set_regs_error(regs, e);
> -        else
> -            ffa_set_regs_success(regs, 0, 0);
> -        return true;
> +        break;
>     case FFA_PARTITION_INFO_GET:
>         e = ffa_handle_partition_info_get(get_user_reg(regs, 1),
>                                           get_user_reg(regs, 2),
> @@ -299,11 +291,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
>         return true;
>     case FFA_RX_RELEASE:
>         e = ffa_handle_rx_release();
> -        if ( e )
> -            ffa_set_regs_error(regs, e);
> -        else
> -            ffa_set_regs_success(regs, 0, 0);
> -        return true;
> +        break;
>     case FFA_MSG_SEND_DIRECT_REQ_32:
>     case FFA_MSG_SEND_DIRECT_REQ_64:
>         handle_msg_send_direct_req(regs, fid);
> @@ -316,17 +304,19 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
>         e = ffa_handle_mem_reclaim(regpair_to_uint64(get_user_reg(regs, 2),
>                                                      get_user_reg(regs, 1)),
>                                    get_user_reg(regs, 3));
> -        if ( e )
> -            ffa_set_regs_error(regs, e);
> -        else
> -            ffa_set_regs_success(regs, 0, 0);
> -        return true;
> +        break;
> 
>     default:
>         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
>         ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
>         return true;
>     }
> +
> +    if ( e )
> +        ffa_set_regs_error(regs, e);
> +    else
> +        ffa_set_regs_success(regs, 0, 0);
> +    return true;
> }
> 
> static int ffa_domain_init(struct domain *d)
> -- 
> 2.34.1
> 




 


Rackspace

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