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

Tom Rini trini at konsulko.com
Mon Aug 2 23:27:59 CEST 2021


On Thu, Jul 29, 2021 at 09:22:02AM +0200, Jan Kiszka wrote:

> From: Jan Kiszka <jan.kiszka at siemens.com>
> 
> This reverts commit 2359fa7a87848626bcbd3399e92c657595880cd7.
> 
> While the goal is valid and there is surely unused memory in that area,
> we also have a lot of crucial things still located at the top-of-memory
> while running lmb_alloc_base. Such things are the page table (tlb_addr),
> relocated U-Boot and the active stack. Possibly more. So this patch was
> premature, we will need relocations of those things first if we want to
> use the range.
> 
> Fixes booting on the IOT2050, but likely also on other boards. It got 
> stuck on relocating the FDT - over the relocated U-Boot code.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
> ---
> 
> Practically,
> 
> void arch_lmb_reserve(struct lmb *lmb)
> {
> 	lmb_reserve(lmb, gd->relocaddr, gd->ram_top - gd->relocaddr);
> }
> 
> worked as well for me - but it left the stack in danger.

I want to cycle back up to this practically part.  Marek, would changing
the arch_lmb_reserve (or possibly even making this a more global thing /
option) still let the area you want exposed on rcar3 (I assume) be
exposed ?  Or would it be covered again?  Part of the problem,
practically speaking, is that we need to ensure that as part of
(attempting and likely succeeding in) booting the OS we don't overwrite
ourself and hang.

An alternative that I'm not 100% sure I like would be adjusting
env_get_bootm_size() so that the case of bootm_size and bootm_low are
unset, so we figure out a value based on gd->ram_top we also take in to
account where U-Boot itself is atm and exclude that.  It's possible that
if we had something like that at the start of the DT world, we wouldn't
have the code to disable fdt relocation, which really feels like it's
largely been "things crash when we relocate stuff, disable relocation"
and not so much "save a little boot time, we optimized things VERY
CAREFULLY".

-- 
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/20210802/83baf414/attachment.sig>


More information about the U-Boot mailing list