Hi Julien,

> -----Original Message-----
> From: Julien Grall <jul...@xen.org>
> Sent: 2022年3月3日 17:15
> To: Wei Chen <wei.c...@arm.com>; Stefano Stabellini
> <sstabell...@kernel.org>
> Cc: xen-devel@lists.xenproject.org; Bertrand Marquis
> <bertrand.marq...@arm.com>; Penny Zheng <penny.zh...@arm.com>; Henry Wang
> <henry.w...@arm.com>; nd <n...@arm.com>
> Subject: Re: Proposal for Porting Xen to Armv8-R64 - DraftA
> 
> Hi Wei,
> 
> On 03/03/2022 01:35, Wei Chen wrote:
> >>> 1. Assembly code for EL1 MPU context_switch
> >>
> >> This discussion reminds me when KVM decided to rewrite their context
> >> switch from assembly to C. The outcome was the compiler is able to do a
> >> better job than us when it comes to optimizing.
> >>
> >> With a C version, we could also share the save/restore code with 32-bit
> >> and it is easier to read/maintain.
> >>
> >> So I would suggest to run some numbers to check if it really worth
> >> implementing the MPU save/restore in assembly.
> >>
> >
> > It's interesting to hear KVM guys have similar discussion. Yes, if the
> > gains of assembly code is not very obvious, then reusing the code for
> 32-bit
> > would be more important. As our current platform (FVP) could not do very
> > precise performance measurement. I want to keep current assembly code
> there,
> > when we have a platform that can do such measurement we can have a
> thread
> > to discuss it.
> 
> I briefly looked at the code, the assembly version is not going to be
> trivial to review and we don't know yet whether it has an advantage. So
> I would say this should be the inverse here.
> 
> We want the C version first until we can prove the assembly version is
> better.
> 
> My gut feeling is we will not need the assembly version.
> 

Ok, we will rollback to C version. After we will finish the measurements,
then we will discuss it again (if the assembly has enough gain).

> Cheers,
> 
> --
> Julien Grall

Reply via email to