[PATCH] arm: apple: Fix mem layout

Simon Glass sjg at chromium.org
Wed Mar 23 19:53:57 CET 2022


Hi Mark,

On Wed, 23 Mar 2022 at 04:18, Mark Kettenis <mark.kettenis at xs4all.nl> wrote:
>
> > From: Simon Glass <sjg at chromium.org>
> > Date: Wed, 23 Mar 2022 03:59:58 -0600
> >
> > Hi Mark,
> >
> > On Mon, 21 Mar 2022 at 15:41, Mark Kettenis <kettenis at openbsd.org> wrote:
> > >
> > > The current approach for setting the environment variables that
> > > describe the memory layout runs the risk of overlapping with
> > > reserved memory regions. Use the lmb code to derive the addresses
> > > for these variables instead.
> > >
> > > Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> > > ---
> > >
> > > Another candidate for 2022.04.  Not a regression either, but the
> > > current code may end up randomly failing due to address space
> > > randomization. The efi_loader bootpath seems to be unaffected, but
> > > attempt to load a Linux kernel directly are more likely to fail.
> > > Also tested widely by people using the Asahi Linux installer.
> >
> > Where is the randomisation happening?
>
> There are a few factors here.  The Apple bootloader loads m1n1 at a
> somewhat random address.  And then there are variations in how U-Boot
> gets loaded (as a m1n1 payload, chainloaded, running under the m1n1
> hypervisor, etc.) that affect which memory ranges end up being
> reserved in the DTB by m1n1.  And the variation in firmware between
> machines makes the memory map somewhat unpredictable too.

OK, thanks, sounds complicated!


>
> > >  arch/arm/mach-apple/board.c | 32 ++++++++++++++------------------
> > >  1 file changed, 14 insertions(+), 18 deletions(-)
> >
> > Reviewed-by: Simon Glass <sjg at chromium.org>
> >


More information about the U-Boot mailing list