All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vincent Stehlé" <vincent.stehle@arm.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Mario Six <mario.six@gdsys.cc>,
	Alper Nebi Yasak <alpernebiyasak@gmail.com>,
	Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>,
	Richard Hughes <hughsient@gmail.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH v3 0/7] efi: CapsuleUpdate: support for dynamic UUIDs
Date: Fri, 21 Jun 2024 19:06:44 +0200	[thread overview]
Message-ID: <ZnWzJKEf1B0RLOyP@debian> (raw)
In-Reply-To: <b2f16a9c-e916-4fbc-9f9c-87b23c0277a5@gmx.de>

On Fri, Jun 21, 2024 at 01:00:51PM +0200, Heinrich Schuchardt wrote:
(..)
> The current specification is in RFC 9562, 4.1, "Variant field"
> 
> "The variant field consists of a variable number of the most significant
> bits of octet 8 of the UUID.
> 
> ...
> 
> Specifically for UUIDs in this document, bits 64 and 65 of the UUID
> (bits 0 and 1 of octet 8) MUST be set to 1 and 0 as specified in row 2
> of Table 1."
> 
> This reference to byte 8 does not depend on endianness.

Hi Heinrich,

Agreed, variant is not concerned by the endianness.

> 
> U-Boot's include/uuid.h has:
> 
>     /* This is structure is in big-endian */
>     struct uuid {
> 
> The field time_hi_and_version needs to be stored in big-endian fashion.

Thanks! I thought this structure was used to hold either a big-endian UUID or a
little-endian GUID, but now you have convinced me.

This confirms that the generation of the dynamic GUID is missing something:

    gen_uuid_v5(&namespace,
                (struct uuid *)&fw_array[i].image_type_id,
                compatible, strlen(compatible),
                fw_array[i].fw_name, u16_strsize(fw_array[i].fw_name)
                    - sizeof(uint16_t),
                NULL);

It is not possible to cast the little-endian efi_guid_t .image_type_id as the
big-endian struct uuid output of gen_uuid_v5() like this; we need to convert the
three time fields from big to little endianness.

> 
> 
> tools/genguid uses UUID_STR_FORMAT_GUID which prints low-endian which is
> typical in the EFI context but not understood by 'uuid -d'. Maybe we
> should add a parameter for the output format.

My understanding is that there is a single universal string format for both
UUIDs and GUIDs, which uuid -d understands, and which has no notion of
endianness. (Only the structures in memory have an endianness.)
This means we do not need an output format parameter.

genguid is calling the new gen_uuid_v5() function, which outputs a big-endian
struct uuid. Therefore, genguid should print it with 'STD format, not 'GUID.

Best regards,
Vincent.

> 
> Best regards
> 
> Heinrich

  reply	other threads:[~2024-06-21 17:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 13:50 [PATCH v3 0/7] efi: CapsuleUpdate: support for dynamic UUIDs Caleb Connolly
2024-05-31 13:50 ` [PATCH v3 1/7] lib: uuid: add UUID v5 support Caleb Connolly
2024-05-31 16:11   ` Ilias Apalodimas
2024-06-05  2:13   ` Simon Glass
2024-06-05 12:06     ` Caleb Connolly
2024-06-05  5:33   ` Heinrich Schuchardt
2024-05-31 13:50 ` [PATCH v3 2/7] efi: add a helper to generate dynamic UUIDs Caleb Connolly
2024-06-05  5:52   ` Heinrich Schuchardt
2024-06-05 12:22     ` Caleb Connolly
2024-05-31 13:50 ` [PATCH v3 3/7] doc: uefi: document dynamic UUID generation Caleb Connolly
2024-05-31 13:50 ` [PATCH v3 4/7] sandbox: switch to dynamic UUIDs Caleb Connolly
2024-05-31 15:43   ` Ilias Apalodimas
2024-05-31 13:50 ` [PATCH v3 5/7] lib: uuid: supporting building as part of host tools Caleb Connolly
2024-05-31 13:50 ` [PATCH v3 6/7] tools: add genguid tool Caleb Connolly
2024-06-05  2:13   ` Simon Glass
2024-06-05  6:36   ` Heinrich Schuchardt
2024-06-05  6:38     ` Heinrich Schuchardt
2024-06-05  9:25     ` Ilias Apalodimas
2024-06-05 12:29       ` Caleb Connolly
2024-06-05 13:43         ` Ilias Apalodimas
2024-06-20 14:58   ` Vincent Stehlé
2024-05-31 13:50 ` [PATCH v3 7/7] test: lib/uuid: add unit tests for dynamic UUIDs Caleb Connolly
2024-06-05  5:59 ` [PATCH v3 0/7] efi: CapsuleUpdate: support " Heinrich Schuchardt
2024-06-05 17:02   ` Caleb Connolly
2024-06-19 14:02 ` Vincent Stehlé
2024-06-19 19:15   ` Ilias Apalodimas
2024-06-21  9:12     ` Vincent Stehlé
2024-06-21 11:00       ` Heinrich Schuchardt
2024-06-21 17:06         ` Vincent Stehlé [this message]
2024-06-21 17:11           ` Caleb Connolly
2024-06-24  9:14             ` Vincent Stehlé
2024-06-21 11:01       ` Ilias Apalodimas
2024-06-21 11:25         ` Ilias Apalodimas
2024-06-21 13:16           ` Heinrich Schuchardt
2024-06-27  9:55       ` [PATCH] Proposed changes to dynamic UUIDs v3 Vincent Stehlé
2024-07-02 13:49         ` Caleb Connolly

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=ZnWzJKEf1B0RLOyP@debian \
    --to=vincent.stehle@arm.com \
    --cc=abdellatif.elkhlifi@arm.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=caleb.connolly@linaro.org \
    --cc=hughsient@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=mario.six@gdsys.cc \
    --cc=sjg@chromium.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 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.