From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
"Da Xue" <da@libre.computer>,
"Vincent Stehlé" <vincent.stehle@arm.com>
Subject: Re: [PATCH 3/5] bootstd: Avoid allocating memory for the EFI file
Date: Thu, 3 Aug 2023 17:46:54 -0400 [thread overview]
Message-ID: <20230803214654.GI3630934@bill-the-cat> (raw)
In-Reply-To: <20230727030128.459760-4-sjg@chromium.org>
[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]
On Wed, Jul 26, 2023 at 09:01:23PM -0600, Simon Glass wrote:
> The current bootflow-iteration algorithm reads the bootflow file into
> an allocated memory buffer so it can be examined. This works well in
> most cases.
>
> However, while the common case is that the first bootflow is immediately
> booted, it is also possible just to scan for available bootflows, perhaps
> selecting one to boot later.
>
> Even with the common case, EFI bootflows can be quite large. It doesn't
> make sense to read it into an allocated buffer when we have kernel_addr_t
> providing a suitable address for it. Even if we do have plenty of malloc()
> space available, it is a violation of U-Boot's lazy-init principle to
> read the bootflow before it is needed.
>
> So overall it seems better to make a change.
>
> Adjust the logic to read just the size of the EFI file at first. Later,
> when the bootflow is booted, read the rest of the file into the designated
> kernel buffer.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reported-by: Da Xue <da@libre.computer>
> Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-08-03 21:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 3:01 [PATCH 0/5] bootstd: Fix some reported problems Simon Glass
2023-07-27 3:01 ` [PATCH 1/5] bootflow: Export setup_fs() Simon Glass
2023-08-03 21:46 ` Tom Rini
2023-07-27 3:01 ` [PATCH 2/5] bootstd: Use a function to detect network in EFI bootmeth Simon Glass
2023-08-03 21:46 ` Tom Rini
2023-07-27 3:01 ` [PATCH 3/5] bootstd: Avoid allocating memory for the EFI file Simon Glass
2023-08-03 21:46 ` Tom Rini [this message]
2023-07-27 3:01 ` [PATCH 4/5] bootstd: Init the size before reading the devicetree Simon Glass
2023-08-03 21:46 ` Tom Rini
2023-07-27 3:01 ` [PATCH 5/5] bootstd: Init the size before reading extlinux file Simon Glass
2023-08-03 21:47 ` Tom Rini
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=20230803214654.GI3630934@bill-the-cat \
--to=trini@konsulko.com \
--cc=da@libre.computer \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=vincent.stehle@arm.com \
/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