All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v5 2/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
@ 2022-08-24  8:23 Michal Orzel
  2022-08-29  7:40 ` Jens Wiklander
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Orzel @ 2022-08-24  8:23 UTC (permalink / raw)
  To: Jens Wiklander, xen-devel
  Cc: Stefano Stabellini, Julien Grall, Volodymyr Babchuk,
	Bertrand.Marquis, Anthony PERARD, Juergen Gross, Wei Liu

Hi Jens,

On 18/08/2022 12:55, Jens Wiklander 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.
> 
Would be good to add a justification that these helpers will be needed by subsequent patches.
Also I can see that you make use of them only in the last patch so it would be natural to
move this patch right before the one making use of these helpers.

> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

As for the patch itself:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v5 2/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
  2022-08-24  8:23 [PATCH v5 2/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h Michal Orzel
@ 2022-08-29  7:40 ` Jens Wiklander
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Wiklander @ 2022-08-29  7:40 UTC (permalink / raw)
  To: Michal Orzel
  Cc: xen-devel, Stefano Stabellini, Julien Grall, Volodymyr Babchuk,
	Bertrand.Marquis, Anthony PERARD, Juergen Gross, Wei Liu

Hi Michal,

On Wed, Aug 24, 2022 at 10:23 AM Michal Orzel <michal.orzel@amd.com> wrote:
>
> Hi Jens,
>
> On 18/08/2022 12:55, Jens Wiklander 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.
> >
> Would be good to add a justification that these helpers will be needed by subsequent patches.
> Also I can see that you make use of them only in the last patch so it would be natural to
> move this patch right before the one making use of these helpers.

I put it at the beginning of the patches to get prerequisites in place
before the tricky stuff, but I'll move it since that's preferred. I'll
add update the commit message.

>
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
>
> As for the patch itself:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Thanks,
Jens

>
> ~Michal


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v5 2/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
  2022-08-18 10:55 [PATCH v5 0/9] Xen FF-A mediator Jens Wiklander
@ 2022-08-18 10:55 ` Jens Wiklander
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Wiklander @ 2022-08-18 10:55 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Julien Grall, Volodymyr Babchuk,
	Bertrand.Marquis, Anthony PERARD, Juergen Gross, Wei Liu,
	Jens Wiklander

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.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 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 794721a103a4..977fc3c07f4a 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.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-29  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24  8:23 [PATCH v5 2/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h Michal Orzel
2022-08-29  7:40 ` Jens Wiklander
  -- strict thread matches above, loose matches on Subject: below --
2022-08-18 10:55 [PATCH v5 0/9] Xen FF-A mediator Jens Wiklander
2022-08-18 10:55 ` [PATCH v5 2/9] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h Jens Wiklander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.