From: Tom Rini <trini@konsulko.com>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Simon Glass <sjg@chromium.org>,
ilias.apalodimas@linaro.org, liviu.dudau@foss.arm.com,
sr@denx.de, patrick.delaunay@foss.st.com, jh80.chung@samsung.com,
michal.simek@amd.com, patrice.chotard@foss.st.com,
ashok.reddy.soma@xilinx.com, u-boot@lists.denx.de,
Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [PATCH v2 3/3] lmb: consider EFI memory map
Date: Wed, 11 Jan 2023 08:59:14 -0500 [thread overview]
Message-ID: <20230111135914.GL3787616@bill-the-cat> (raw)
In-Reply-To: <b4a5c445-4216-7eb5-f7e5-dd58ad051f10@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 2917 bytes --]
On Wed, Jan 11, 2023 at 08:43:37AM +0100, Heinrich Schuchardt wrote:
>
>
> On 1/11/23 01:15, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Mon, 9 Jan 2023 at 13:53, Heinrich Schuchardt
> > <heinrich.schuchardt@canonical.com> wrote:
> > >
> > >
> > >
> > > On 1/9/23 21:31, Simon Glass wrote:
> > > > Hi Mark,
> > > >
> > > > On Mon, 9 Jan 2023 at 13:20, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > > >
> > > > > > From: Simon Glass <sjg@chromium.org>
> > > > > > Date: Mon, 9 Jan 2023 13:11:01 -0700
> > > > > >
> > > > > > Hi Heinrich,
> > > > > >
> > > > > >
> > > > > > We need to fix how EFI does addresses. It seems to use them as
> > > > > > pointers but store them as u64 ?
> > >
> > > That is similar to what you have been doing with physical addresses.
> > >
> > > > >
> > > > > They're defined to a 64-bit unsigned integer by the UEFI
> > > > > specification, so you can't change it.
> > > >
> > > > I don't mean changing the spec, just changing the internal U-Boot
> > > > implementation, which is very confusing. This confusion is spreading
> > > > out, too.
> > > >
> > > > Regards,
> > > > Simon
> > >
> > > The real interesting thing is how memory should be managed in U-Boot:
> > >
> > > I would prefer to create a shared global memory management on 4KiB page
> > > level used both for EFI and the rest of U-Boot.
> >
> > Sounds good.
> >
> > >
> > > What EFI adds to the requirements is that you need more than free
> > > (EfiConventionalMemory) and used memory. EFI knows 16 different types of
> > > memory usage (see enum efi_memory_type).
> >
> > That's a shame. How much of this is legacy and how much is useful?
> >
> > >
> > > When loading a file (e.g. with the "load" command) this should lead to a
> > > memory reservation. You should not be able to load a second file into an
> > > overlapping memory area without releasing the allocated memory first.
> > >
> > > This would replace lmb which currently tries to recalculate available
> > > memory ab initio again and again.
> > >
> > > With managed memory we should be able to get rid of all those constants
> > > like $loadaddr, $fdt_addr_r, $kernel_addr_r, etc. and instead use a
> > > register of named loaded files.
> >
> > This is where standard boot comes in, since it knows what it has
> > loaded and has pointers to it.
> >
> > I see a future where we don't use these commands when we want to save
> > space. It can save 300KB from the U-Boot size.
> >
> > But this really has to come later, since there is so much churn already!
> >
> > For now, please don't add EFI allocation into lmb..that is just odd.
>
> It is not odd but necessary. Without it the Odroid C2 does not boot but
> crashes.
It's not Odroid C2, it's anything that with the bad luck to relocate
over the unprotected EFI structures.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-01-11 13:59 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 20:25 [PATCH v2 0/3] efi_loader: consider EFI memory map Heinrich Schuchardt
2023-01-05 20:25 ` [PATCH v2 1/3] vexpress: adjust loadaddr Heinrich Schuchardt
2023-01-05 20:25 ` [PATCH v2 2/3] efi_loader: carve out efi_get_memory_map_alloc() Heinrich Schuchardt
2023-01-06 23:22 ` Vagrant Cascadian
2023-01-09 7:18 ` Ilias Apalodimas
2023-01-09 8:06 ` Heinrich Schuchardt
2023-01-09 13:00 ` Ilias Apalodimas
2023-01-05 20:25 ` [PATCH v2 3/3] lmb: consider EFI memory map Heinrich Schuchardt
2023-01-06 23:22 ` Vagrant Cascadian
2023-01-09 7:19 ` Ilias Apalodimas
2023-01-09 20:11 ` Simon Glass
2023-01-09 20:20 ` Mark Kettenis
2023-01-09 20:31 ` Simon Glass
2023-01-09 20:53 ` Heinrich Schuchardt
2023-01-11 0:15 ` Simon Glass
2023-01-11 7:43 ` Heinrich Schuchardt
2023-01-11 13:59 ` Tom Rini [this message]
2023-01-11 16:48 ` Simon Glass
2023-01-11 16:59 ` Heinrich Schuchardt
2023-01-11 17:40 ` Mark Kettenis
2023-01-11 17:50 ` Heinrich Schuchardt
2023-01-11 17:55 ` Simon Glass
2023-01-11 18:03 ` Heinrich Schuchardt
2023-01-11 21:08 ` Simon Glass
2023-01-11 22:59 ` Mark Kettenis
2023-01-11 23:35 ` Heinrich Schuchardt
2023-01-12 1:13 ` Tom Rini
2023-01-11 23:36 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230111135914.GL3787616@bill-the-cat \
--to=trini@konsulko.com \
--cc=ashok.reddy.soma@xilinx.com \
--cc=heinrich.schuchardt@canonical.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jh80.chung@samsung.com \
--cc=liviu.dudau@foss.arm.com \
--cc=mark.kettenis@xs4all.nl \
--cc=michal.simek@amd.com \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox