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

Re: [XEN PATCH v7 15/20] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 3 Mar 2023 10:51:00 +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=WmR9G8IZqGsaKBKUmsPPY0EdU70TZ1wJi1bKDS4ntcc=; b=Wz4WRjPwO5DgNmS14XsXAQwR/sZUTBaSvQn6OUC51xafyI1K5Fr0z2WKXHq8nEi8oekN5jnFVNp+zg+AmsuY5M0phgAfE3TURO6qUT7+3AOUuQ1xUCcly7M4QBZxF7EBTjJvJM24/0yyxbggWygeVOB8SkLJQNzgt4Dffjp/s9iyScPzfpzoE5qy+cO78OBxCK7LmGtljmWIokbjfP6kFx/y8fg2gG9RBSjtZqS5JB3ga8CUigQbWFoaX4AW6IRJ4G4ygjUF0MYiZJRhEErgJ530K0G6hpPiJbelMe7V5XYHlG7kTRhlXBJcMuelUVmGgmimCjtQEAaGFZEK1MC+2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CwVX31M8/RYlfNA1nd4RYj2pvC3QHmU/W/QicH/3dh7oo+pdopIQcv3ErxJMm0b5nCL/Mv0yoQvh8t8iqLlwGLHEs8JuPmB8MgJwSIRBZsMhq3LOLOjITG/Mt0IKlRGruDctqiY/to7BsyBNQ3lp+tHgBgmpMDwr8cftrkS/ee6fEr3vITjv7Un/5aVInB6tlECtBcf8MG7I3yavkE+sSuLUgGbh97Nnb9oDN30rRXV50bYKRcC3pLQC/o5rwYzKdFUuLfFfUe6WBAskQWw9ToRofnznP7hAbptYhDnBGpByCeA1/OOgnStSU0Cn3Q5R5QWgiQwmAB81nHFDddkh6Q==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 03 Mar 2023 10:51:51 +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: AQHZRtMhup5QB/7pQ0mR9lSg6Z90EK7o7mGA
  • Thread-topic: [XEN PATCH v7 15/20] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h

Hi Jens,

> On 22 Feb 2023, at 16:33, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
> 
> Moves the two helper functions regpair_to_uint64() and
> uint64_to_regpair() from xen/arch/arm/tee/optee.c to the common arm
> specific regs.h. This enables reuse of these functions in the FF-A
> mediator in a subsequent patch.
> 
> Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>

Please move Michal R-B after your signed off.

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

Cheers
Bertrand

> ---
> xen/arch/arm/include/asm/regs.h | 12 ++++++++++++
> xen/arch/arm/tee/optee.c        | 11 -----------
> 2 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
> index 0693a681315f..aa39e83ee5f4 100644
> --- a/xen/arch/arm/include/asm/regs.h
> +++ b/xen/arch/arm/include/asm/regs.h
> @@ -60,6 +60,18 @@ static inline bool guest_mode(const struct cpu_user_regs 
> *r)
> register_t get_user_reg(struct cpu_user_regs *regs, int reg);
> void set_user_reg(struct cpu_user_regs *regs, int reg, register_t val);
> 
> +static inline uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
> +{
> +    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
> +}
> +
> +static inline void uint64_to_regpair(register_t *reg0, register_t *reg1,
> +                                     uint64_t val)
> +{
> +    *reg0 = val >> 32;
> +    *reg1 = (uint32_t)val;
> +}
> +
> #endif
> 
> #endif /* __ARM_REGS_H__ */
> diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
> index 9cb9f16d43cb..47027ecef47c 100644
> --- a/xen/arch/arm/tee/optee.c
> +++ b/xen/arch/arm/tee/optee.c
> @@ -268,17 +268,6 @@ static int optee_domain_init(struct domain *d)
>     return 0;
> }
> 
> -static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
> -{
> -    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
> -}
> -
> -static void uint64_to_regpair(register_t *reg0, register_t *reg1, uint64_t 
> val)
> -{
> -    *reg0 = val >> 32;
> -    *reg1 = (uint32_t)val;
> -}
> -
> static struct page_info *get_domain_ram_page(gfn_t gfn)
> {
>     struct page_info *page;
> -- 
> 2.34.1
> 




 


Rackspace

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