[PATCH] Revert "arm: bootm: Disable LMB reservation for command line and board info on arm64"

Tom Rini trini at konsulko.com
Mon Aug 9 14:53:14 CEST 2021


On Mon, Aug 09, 2021 at 08:44:58AM +0200, Wolfgang Denk wrote:
> Dear Marek,
> 
> In message <03720507-5ea4-0fb9-0549-37df3128be2b at denx.de> you wrote:
> >
> > The IMX thing is odd indeed and raises a bigger question -- what is the 
> > "right" amount of stack to reserve ?
> 
> In the original U-Boot design (which is still documented in the
> README, see section "Memory Management", start reading at "typical
> memory configuration") The stack was located below the lowest
> reserved address range, so it could grow downward, only limited by
> available memory size.  And yes, it was the responsibility of the
> user to make sure not to overwrite it for example by loading images
> at too high addresses or running "mw" with unsuitable address or
> size.
> 
> What I want to point out is: there are probably a number of areas in
> U-Boot which are based on this assumption, as reserving buffers or
> the like on the stack is a much cheaper operation with much less
> potential for memory leaks etc. than using malloc().
> 
> Any assumption that a stack size of 4 kB or 16 kB or such will be
> sufficient is ... optimistic at best.

Ah right, and here's why we call, in the kernel path, the LMB code where
we do.  We take the current stack pointer, round it, relocate device
tree/initrd and then go away.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210809/9759be16/attachment.sig>


More information about the U-Boot mailing list