All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyle Evans <kevans@freebsd.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Alexander Graf <agraf@csgraf.de>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Simon Glass <sjg@chromium.org>,
	Joao Marcos Costa <joaomarcos.costa@bootlin.com>,
	 Richard Genoud <richard.genoud@posteo.net>,
	Niel Fourie <lusus@denx.de>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 3/3] efi_loader: setting boot device
Date: Sun, 3 Apr 2022 16:08:33 -0500	[thread overview]
Message-ID: <CACNAnaHrO-ZrWJOnigGM5Rno3HsWj2PGQbXPRbSKy7ofSjZgwQ@mail.gmail.com> (raw)
In-Reply-To: <20210112195842.252946-4-xypron.glpk@gmx.de>

 On Tue, Jan 12, 2021 at 1:59 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Up to now the bootefi command used the last file loaded to determine the
> boot partition. This has led to errors when the fdt had been loaded from
> another partition after the EFI binary.
>
> Before setting the boot device from a loaded file check if it is a PE-COFF
> image or a FIT image.
>
> For a PE-COFF image remember address and size, boot device and path.
>
> For a FIT image remember boot device and path.
>
> If the PE-COFF image is overwritten by loading another file, forget it.
>
> Do not allow to start an image via bootefi which is not the last loaded
> PE-COFF image.
>

Hi,

I'm only a little late on this, but may I ask what the rationale of
this last part is? I'm afraid there are some real-world use cases
where a compromise would be great, allowing bootefi to accept a random
region of memory to boot -- in my case, I have the payload (FreeBSD's
loader.efi) already in memory when U-Boot starts and it's unclear that
I can come up with some other way to boot it that doesn't involve a
lot of backflips.

My specific suggestion, which I can formally post to the list if you
don't immediately object, is this:
https://people.freebsd.org/~kevans/uboot.patch

It basically adds another form:

`bootefi addr [fdt [size]]`

If $addr isn't the last loaded PE-COFF, size must be provided. fdt can
be `-` to signal EFI_FDT_USE_INTERNAL. If we provide an address that
isn't the last loaded PE-COFF, it wipes out the device path and lets
efi_run_image() synthesize it. Providing a size with the address of
the last loaded PE-COFF is an error, but that's a bit arbitrary.

Obviously our loader doesn't get good source disk information this way
and I have to drive it manually, but that's still orders of magnitude
better than having to locally shuffle new loader.efis onto a flash
drive and keep moving the flash drive back and forth to iterate on it.

Thans,

Kyle Evans

  parent reply	other threads:[~2022-04-03 21:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 19:58 [PATCH 0/3] efi_loader: setting boot device Heinrich Schuchardt
2021-01-12 19:58 ` [PATCH 1/3] efi_loader: print boot device and file path in helloworld Heinrich Schuchardt
2021-01-14 15:42   ` Simon Glass
2021-01-15  1:56   ` AKASHI Takahiro
2021-01-15  3:12     ` Heinrich Schuchardt
2021-01-15  4:29       ` AKASHI Takahiro
2021-01-15 12:02         ` Heinrich Schuchardt
2021-01-18  1:38           ` AKASHI Takahiro
2021-01-12 19:58 ` [PATCH 2/3] efi_loader: carve out efi_check_pe() Heinrich Schuchardt
2021-01-14 15:42   ` Simon Glass
2021-01-12 19:58 ` [PATCH 3/3] efi_loader: setting boot device Heinrich Schuchardt
2021-01-19 18:06   ` Simon Glass
2021-01-19 18:43     ` Heinrich Schuchardt
2021-01-20  0:15       ` Simon Glass
2022-04-03 21:08   ` Kyle Evans [this message]
2022-04-04  5:09     ` Heinrich Schuchardt
2022-04-04  5:40       ` Kyle Evans
2022-04-04  5:58         ` Heinrich Schuchardt
2022-04-04 14:51           ` Kyle Evans

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=CACNAnaHrO-ZrWJOnigGM5Rno3HsWj2PGQbXPRbSKy7ofSjZgwQ@mail.gmail.com \
    --to=kevans@freebsd.org \
    --cc=agraf@csgraf.de \
    --cc=joaomarcos.costa@bootlin.com \
    --cc=joe.hershberger@ni.com \
    --cc=lusus@denx.de \
    --cc=richard.genoud@posteo.net \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.