From: "Vincent Stehlé" <vincent.stehle@arm.com>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Tom Rini <trini@konsulko.com>,
u-boot@lists.denx.de
Subject: Re: [PATCH 3/4] cmd: efidebug: add ecpt command
Date: Mon, 9 Mar 2026 16:02:07 +0100 [thread overview]
Message-ID: <aa7g7zd0L4SyDHt-@debian> (raw)
In-Reply-To: <a0d7e83b-1721-41c6-a416-cc88af49bb22@gmx.de>
On Mon, Mar 09, 2026 at 01:23:53PM +0100, Heinrich Schuchardt wrote:
Hi Heinrich,
Thanks for your review, I will send a v2 adding your first suggestion; more
comments below.
Best regards,
Vincent.
> On 3/5/26 17:13, Vincent Stehlé wrote:
> > Add an "efidebug ecpt" command, to print the conformance profiles in the
> > ECPT:
> >
> > => efidebug ecpt
> > cce33c35-74ac-4087-bce7-8b29b02eeb27 EFI EBBR 2.1 Conformance Profile
> >
> > Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> > Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > Cc: Tom Rini <trini@konsulko.com>
> > ---
> > cmd/efidebug.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 49 insertions(+)
> >
> > diff --git a/cmd/efidebug.c b/cmd/efidebug.c
> > index 109496d9e95..672214a54b7 100644
> > --- a/cmd/efidebug.c
> > +++ b/cmd/efidebug.c
> > @@ -533,6 +533,47 @@ static int do_efi_show_defaults(struct cmd_tbl *cmdtp, int flag,
> > return CMD_RET_SUCCESS;
> > }
> > +#if CONFIG_IS_ENABLED(EFI_ECPT)
> > +/**
> > + * do_efi_show_ecpt() - show UEFI conformance profiles in ECPT
> > + *
> > + * @cmdtp: Command table
> > + * @flag: Command flag
> > + * @argc: Number of arguments
> > + * @argv: Argument array
> > + * Return: CMD_RET_SUCCESS on success,
> > + * CMD_RET_USAGE or CMD_RET_FAILURE on failure
> > + *
> > + * Implement efidebug "ecpt" sub-command.
> > + * Show all the UEFI Conformance Profiles listed in the EFI Conformance Profiles
> > + * Table (ECPT).
> > + */
> > +static int do_efi_show_ecpt(struct cmd_tbl *cmdtp, int flag, int argc,
> > + char *const argv[])
> > +{
> > + const struct efi_conformance_profiles_table *ecpt;
> > + u16 n;
> > +
> > + if (argc != 1)
> > + return CMD_RET_USAGE;
> > +
> > + ecpt = efi_get_configuration_table(&efi_ecpt_guid);
> > + if (!ecpt) {
> > + log_info("ECPT: table not present\n");
>
> This looks like an error situation. Should this be:
>
> log_err("ECPT table missing\n");
Ok, I will change this as you suggest and send a v2, returning CMD_RET_FAILURE,
then.
Note that I did hesitate and finally opted to replicate what
do_efi_capsule_esrt() was doing, but I think reporting an error as you suggest
makes more sense as we know that we should have an ECPT when CONFIG_EFI_ECPT=y.
>
> > + return CMD_RET_SUCCESS;
> > + }
> > +
> > + for (n = 0; n < ecpt->number_of_profiles; n++) {
> > + const efi_guid_t *guid = &ecpt->conformance_profiles[n];
> > +
> > + printf("%pUl %s\n", guid->b,
> > + uuid_guid_get_str(guid->b) ?: "(unknown)");
>
> Isn't the following enough:
>
> printf("%pUs\n");
>
> %pUs: GUID text representation if known or fallback to %pUl
For this printing change I am not so sure; this is inspired from
efi_show_tables()'s behaviour and the intention is to have the following
outputs, depending on whether we know the GUID or not:
cce33c35-74ac-4087-bce7-8b29b02eeb27 EFI EBBR 2.1 Conformance Profile
or cce33c35-74ac-4087-bce7-8b29b02eeb27 (unknown)
With the change you suggest, we would have:
EFI EBBR 2.1 Conformance Profile
or cce33c35-74ac-4087-bce7-8b29b02eeb27
I think I prefer the original solution, as it more in line with `efidebug
tables' and it always shows the GUID in numerical form, but let me know if you
insist, in which case I will send a v3 with this change as well.
>
> Best regards
>
> Heinrich
>
> > + }
> > +
> > + return CMD_RET_SUCCESS;
> > +}
> > +#endif /* CONFIG_IS_ENABLED(EFI_ECPT) */
> > +
> > static const char * const efi_mem_type_string[] = {
> > [EFI_RESERVED_MEMORY_TYPE] = "RESERVED",
> > [EFI_LOADER_CODE] = "LOADER CODE",
> > @@ -1586,6 +1627,10 @@ static struct cmd_tbl cmd_efidebug_sub[] = {
> > "", ""),
> > U_BOOT_CMD_MKENT(defaults, CONFIG_SYS_MAXARGS, 1, do_efi_show_defaults,
> > "", ""),
> > +#if CONFIG_IS_ENABLED(EFI_ECPT)
> > + U_BOOT_CMD_MKENT(ecpt, CONFIG_SYS_MAXARGS, 1, do_efi_show_ecpt,
> > + "", ""),
> > +#endif
> > U_BOOT_CMD_MKENT(images, CONFIG_SYS_MAXARGS, 1, do_efi_show_images,
> > "", ""),
> > U_BOOT_CMD_MKENT(memmap, CONFIG_SYS_MAXARGS, 1, do_efi_show_memmap,
> > @@ -1680,6 +1725,10 @@ U_BOOT_LONGHELP(efidebug,
> > " - show UEFI handles\n"
> > "efidebug defaults\n"
> > " - show default EFI filename and PXE architecture\n"
> > +#if CONFIG_IS_ENABLED(EFI_ECPT)
> > + "efidebug ecpt\n"
> > + " - show conformance profiles in the ECPT\n"
> > +#endif
> > "efidebug images\n"
> > " - show loaded images\n"
> > "efidebug memmap\n"
>
next prev parent reply other threads:[~2026-03-09 15:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 16:13 [PATCH 0/4] Add an efidebug ecpt command Vincent Stehlé
2026-03-05 16:13 ` [PATCH 1/4] lib: uuid: add EBBR 2.1 conformance profile GUID Vincent Stehlé
2026-03-09 12:19 ` Heinrich Schuchardt
2026-03-09 14:38 ` Vincent Stehlé
2026-03-05 16:13 ` [PATCH 2/4] efi_loader: export efi_ecpt_guid Vincent Stehlé
2026-03-09 12:26 ` Heinrich Schuchardt
2026-03-05 16:13 ` [PATCH 3/4] cmd: efidebug: add ecpt command Vincent Stehlé
2026-03-09 12:23 ` Heinrich Schuchardt
2026-03-09 15:02 ` Vincent Stehlé [this message]
2026-03-05 16:13 ` [PATCH 4/4] test/py: add ECPT tests Vincent Stehlé
2026-03-09 12:37 ` Heinrich Schuchardt
2026-03-09 16:36 ` [PATCH v2 1/4] lib: uuid: add EBBR 2.1 conformance profile GUID Vincent Stehlé
2026-03-09 16:38 ` Heinrich Schuchardt
2026-03-11 16:14 ` Ilias Apalodimas
2026-03-09 16:36 ` [PATCH v2 2/4] efi_loader: export efi_ecpt_guid Vincent Stehlé
2026-03-09 16:40 ` Heinrich Schuchardt
2026-03-09 17:34 ` Vincent Stehlé
2026-03-11 16:24 ` Ilias Apalodimas
2026-03-09 16:36 ` [PATCH v2 3/4] cmd: efidebug: add ecpt command Vincent Stehlé
2026-03-09 16:41 ` Heinrich Schuchardt
2026-03-11 16:20 ` Ilias Apalodimas
2026-03-09 16:36 ` [PATCH v2 4/4] test/py: add ECPT tests Vincent Stehlé
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=aa7g7zd0L4SyDHt-@debian \
--to=vincent.stehle@arm.com \
--cc=heinrich.schuchardt@canonical.com \
--cc=ilias.apalodimas@linaro.org \
--cc=trini@konsulko.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox