From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Simon Glass <sjg@chromium.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
Tom Rini <trini@konsulko.com>,
AKASHI Takahiro <akashi.tkhro@gmail.com>,
U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH 6/6] efi: Show the location of the bounce buffer
Date: Thu, 25 Jul 2024 18:31:53 +0200 [thread overview]
Message-ID: <e4e7e085-aacc-4c2e-99dc-924a1ef22c46@gmx.de> (raw)
In-Reply-To: <20240725135629.3505072-7-sjg@chromium.org>
On 25.07.24 15:56, Simon Glass wrote:
> The EFI_LOADER_BOUNCE_BUFFER feature was added many years ago. It is not
> clear whether it is still needed, but 24 boards (lx2160ardb_tfa_stmm,
> lx2162aqds_tfa_SECURE_BOOT and the like) use it.
>
> This feature uses EFI page allocation to create a 64MB buffer 'in space'
> without any knowledge of where boards intend to load their images. This
> may result in image corruption or other problems.
This is what Sughosh's LMB series in addressing.
With CONFIG_SYS_MALLOC_LEN=0x202000 for lx2160ardb_tfa_stmm we cannot
move the buffer to malloc(). I don't understand why
CONFIG_SYS_MALLOC_LEN is so small.
>
> For example, if the feature is enabled on qemu_arm64 it puts the EFI
> bounce buffer at 1045MB, with the kernel at 1028MB and the ramdisk at
> 1088MB. The kernel is probably smaller than 27MB but the buffer does
> overlap the ramdisk.
>
> The solution is probably to use BOUNCE_BUFFER instead, with the EFI
> version being dropped. For now, show the address of the EFI bounce
> buffer so people have a better chance to detect the problem.
>
> Note: I avoided converting this #ifdef to use IS_ENABLED() since I hope
> that the feature may be removed.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> lib/efi_loader/efi_bootbin.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
> index 07c8fca68cc..53e5e429d2e 100644
> --- a/lib/efi_loader/efi_bootbin.c
> +++ b/lib/efi_loader/efi_bootbin.c
> @@ -211,6 +211,14 @@ efi_status_t efi_binary_run(void *image, size_t size, void *fdt)
> return -1;
> }
>
> +#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER
> + /*
> + * Add a warning about this buffer, since it may conflict with other
> + * things
> + */
> + printf("EFI bounce buffer at %p\n", efi_bounce_buffer);
> +#endif
Does this sound like a warning to you?
There is nothing that a user can reasonably do when seeing this message
while the board is booting via one of the boot methods. So we should not
write it.
Best regards
Heinrich
> +
> ret = efi_install_fdt(fdt);
> if (ret != EFI_SUCCESS)
> return ret;
next prev parent reply other threads:[~2024-07-25 16:32 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 13:56 [PATCH 0/6] efi: Start tidying up memory management Simon Glass
2024-07-25 13:56 ` [PATCH 1/6] doc: Show more information in efi index Simon Glass
2024-07-25 16:02 ` Heinrich Schuchardt
2024-07-25 13:56 ` [PATCH 2/6] efi: Convert device_path allocation to use malloc() Simon Glass
2024-07-25 16:13 ` Heinrich Schuchardt
2024-07-25 23:32 ` Simon Glass
2024-07-25 13:56 ` [PATCH 3/6] efi: Allow monitoring of page allocations Simon Glass
2024-07-25 16:20 ` Heinrich Schuchardt
2024-07-25 23:33 ` Simon Glass
2024-07-25 13:56 ` [PATCH 4/6] efi: Avoid pool allocation in efi_get_memory_map_alloc() Simon Glass
2024-07-25 16:38 ` Heinrich Schuchardt
2024-07-31 14:39 ` Simon Glass
2024-07-25 13:56 ` [PATCH 5/6] efi: Use malloc() for the EFI pool Simon Glass
2024-07-25 15:49 ` Heinrich Schuchardt
2024-07-25 23:32 ` Simon Glass
2024-07-26 8:31 ` Ilias Apalodimas
2024-07-26 14:54 ` Simon Glass
2024-07-29 10:01 ` Ilias Apalodimas
2024-07-29 15:28 ` Simon Glass
2024-07-30 8:19 ` Ilias Apalodimas
2024-07-30 14:38 ` Simon Glass
2024-07-30 14:53 ` Mark Kettenis
2024-07-30 15:18 ` Simon Glass
2024-07-30 14:53 ` Ilias Apalodimas
2024-07-30 15:18 ` Simon Glass
2024-07-30 15:24 ` Tom Rini
2024-07-30 19:42 ` Simon Glass
2024-07-30 19:49 ` Tom Rini
2024-07-30 20:05 ` Simon Glass
2024-07-30 20:11 ` Tom Rini
2024-07-30 20:52 ` Simon Glass
2024-07-30 21:20 ` Tom Rini
2024-07-31 14:39 ` Simon Glass
2024-07-31 17:17 ` Tom Rini
2024-08-01 10:14 ` Ilias Apalodimas
2024-08-01 16:14 ` Simon Glass
2024-08-01 16:22 ` Ilias Apalodimas
2024-08-01 17:43 ` Simon Glass
2024-07-31 7:39 ` Ilias Apalodimas
2024-07-31 14:39 ` Simon Glass
2024-07-25 13:56 ` [PATCH 6/6] efi: Show the location of the bounce buffer Simon Glass
2024-07-25 16:31 ` Heinrich Schuchardt [this message]
2024-07-31 14:39 ` Simon Glass
2024-07-25 14:25 ` [PATCH 0/6] efi: Start tidying up memory management Ilias Apalodimas
2024-07-25 15:58 ` 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=e4e7e085-aacc-4c2e-99dc-924a1ef22c46@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=akashi.tkhro@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--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