[Linux-Xtensa] RAM load/store reorder

Baruch Siach baruch at tkos.co.il
Thu Nov 28 04:38:33 UTC 2013


Hi Marc,

On Wed, Nov 27, 2013 at 04:21:54PM -0800, Marc Gauthier wrote:
> Reloading a3:  some artifact of dynamic loading?  is the called function in 
> a separate .so ?

The called function is in the same file 
(https://github.com/czankel/xtensa-uboot/blob/master/lib/libfdt/fdt.c). In the 
dynamic loading case I'd expect the code to reload from GOT, not from stack. 
But there is no dynamic loading in U-Boot for sure.

baruch

> ________________________________
> From: Chris Zankel [mailto:chris at zankel.net]
> Sent: Wednesday, November 27, 2013 16:15
> To: Baruch Siach; Marc Gauthier
> Subject: Re: [Linux-Xtensa] RAM load/store reorder
> 
> Hi Baruch,
> 
> Basically came to the same conclusions as the two of you when I looked at it 
> this morning. There seems to be a weird reordering execution issue. Are you 
> using just the default bitstream from Tensilica? What version? Were there 
> any changes to the external memory? I'd be surprised that we hadn't caught 
> such an issue when running the kernel and other tools on that board before.
> 
> Regarding the compiler, it's really weird that it would reload a3 for every 
> loop. Marc, you probably don't have the entire disassembled function in 
> front of you, so here it is.
> 
> (I can't really come up with any explanation other than that it might have 
> optimized out some additional code, but that would have been something 
> rather complex like TLS or so... weird..)
> 
> 
> 00000344 <fdt_next_subnode>:
>      344:       008136          entry   a1, 64
>      347:       03bd            mov.n   a11, a3
>      349:       ff3331          l32r    a3, 18 <___arch__swab32-0xfc>
>      34c:       180c            movi.n  a8, 1
>      34e:       0189            s32i.n  a8, a1, 0
>      350:       4139            s32i.n  a3, a1, 16
> 
> JUMP_LABEL
>      352:       4138            l32i.n  a3, a1, 16    # reloads a3 for every loop, but a3 never changes
>      354:       02ad            mov.n   a10, a2
>      356:       20c110          or      a12, a1, a1
>      359:       0003e0          callx8  a3
>      35c:       0abd            mov.n   a11, a10
>      35e:       00aa96          bltz    a10, 36c <fdt_next_subnode+0x28>
>      361:       0188            l32i.n  a8, a1, 0
>      363:       0518a6          blti    a8, 1, 36c <fdt_next_subnode+0x28>
>      366:       e81866          bnei    a8, 1, JUMP_LABEL ## 352 <fdt_next_subnode+0xe>
> 
>      369:       000046          j       36e <fdt_next_subnode+0x2a>
>      36c:       fb7c            movi.n  a11, -1
>      36e:       0b2d            mov.n   a2, a11
>      370:       f01d            retw.n

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the linux-xtensa mailing list