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

Tom Rini trini at konsulko.com
Mon Aug 9 16:21:01 CEST 2021


On Mon, Aug 09, 2021 at 04:11:36PM +0200, Wolfgang Denk wrote:
> Dear Tom,
> 
> In message <20210809131640.GN858 at bill-the-cat> you wrote:
> > 
> > Thanks for explaining.  It sounds like
> > arch/arm/mach-imx/imx8m/soc.c::the=A0ft_system_setup() needs a comment
> > that it uses a lot of stack, due to how complex it is, and that
> 
> I think this is the wrong approach.  It sounds as if we were
> discouragin the use of the stack for dynamic buffers etc. We should
> not do that. Instead, we should make sure that the stack starts
> below any reserved memory locations, and is free to grow downward as
> long as there is still memory available.
> 
> If U-Boot was an OS, we would probably think about implementing a
> more complex memory management utilizing the MMU, but in a boot
> loader this is clearly overkill.  But please, just let the stack
> grow as it wants.
> 
> There may be completely legal use cases with unpredictable stack
> requirements.  Think about recursive shell scripts, for example...

This is a problem of the specific flow of the code.  Generally, you're
right, and that's what we do.  Here specifically, I'm not sure we could
rework the flow to have a place where we call ft_system_setup prior to
lmb.  The alternative, which would cover most cases at least, is to make
sure everyone sets bootm_size and we stop with "all of DRAM, with a few
exceptions, is where to relocate kernel/dtb/initrd to" being the default
case.

-- 
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/8faceedb/attachment.sig>


More information about the U-Boot mailing list