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

Re: [Xen-devel] [PATCH v3 20/28] xen/arm32: head: Remove 1:1 mapping as soon as it is not used



Sorry for the formatting.

On Thu, 22 Aug 2019, 23:55 Stefano Stabellini, <sstabellini@xxxxxxxxxx> wrote:
On Thu, 22 Aug 2019, Julien Grall wrote:
> > >            */
> > > -        dsb
> > > +        lsr   r1, r9, #FIRST_SHIFT
> > > +        mov_w r0, LPAE_ENTRY_MASK
> >
> > ldr?
>
> What's wrong with the mov_w? Ok it is two instructions but... the constant
> will be stored in a literal and therefore induce a memory load (see patch #8).

I am just wondering why you would choose mov_w when you can just do a
single simple ldr.

Well, I have just explained it and you likely saw the explanation in patch #8 as you acked it. So I am not sure what other explanation you are looking for.

The choice between ldr rX, =... and mov_w is pretty much a matter of taste from our perspective.

They will both take 64-bit in memory, the former because of one instruction and the constant stored in the literal pool. The latter because it is using two instructions.

Technically, we could also reduce the number of instructions to one for mov_w depending on the constant size. But that's micro-optimization.

mov_w will be slightly more efficient because you don't have an extra memory load (from loading from a pool). Although it is pretty much insignificant here.

I also have to admit that the syntax for ldr is slightly confusing. I always have to look up in other place how it can be used and works.

So I would like to keep the ldr use to the strict minimum, i.e. for non-cons value (such as symbol).

Cheers,
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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