From: Laszlo Ersek <lersek@redhat.com>
To: Leif Lindholm <leif.lindholm@linaro.org>,
AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Alexander Graf <agraf@suse.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
trini@konsulko.com, robdclark@gmail.com, u-boot@lists.denx.de,
edk2-devel@lists.01.org, Jian J Wang <jian.j.wang@intel.com>,
Hao Wu <hao.a.wu@intel.com>, Ruiyu Ni <ruiyu.ni@intel.com>,
Star Zeng <star.zeng@intel.com>, Andrew Fish <afish@apple.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [RESEND PATCH v2 2/6] efi_loader: Initial HII database protocols
Date: Mon, 7 Jan 2019 19:29:47 +0100 [thread overview]
Message-ID: <7d6fbbff-ca48-588a-6082-bf8b95a7e829@redhat.com> (raw)
In-Reply-To: <20190107140932.uefkly3a3jzlyjjf@bivouac.eciton.net>
On 01/07/19 15:09, Leif Lindholm wrote:
> Apologies for late reply, back from holidays today.
>
I'm going to snip a whole lot of context below, since I have no idea
what project this is about, and/or what files in that project (no diff
hunk headers in the context). Judged from the address list, is this
about u-boot perhaps? And adding type definitions to u-boot so they
conform to the UEFI spec, and (assuming this "and" is possible) match
edk2 practice?
> My understanding is this:
> - The EDK2 implementation does not conform to the specification; it
> completely packs the EFI_HII_KEYBOARD_LAYOUT, which the
> specification does not mention anything about. Since this code is
> well in the wild, and drivers tested against the current layout need
> to continuw eorking, I expect the only possible solution is to
> update the specification to say EFI_HII_KEYBOARD_LAYOUT must be
> packed.
I'm going to take a pass on this. :)
> - The default EDK2 definition of GUID (and hence EFI_GUID) gives it a
> 32-bit alignment requirement also on 64-bit architectures. In
> practice, I expect this would only affect (some of the) GUIDs that
> are members of structs used in UEFI interfaces. But that may already
> be too common an occurrence to audit and address in EDK2. Does the
> spec need to change on this also?
The UEFI spec (v2.7) explicitly requires EFI_GUID to be 64-bit aligned,
unless specified otherwise. See in "Table 5. Common UEFI Data Types":
EFI_GUID -- 128-bit buffer containing a unique identifier value.
Unless otherwise specified, aligned on a 64-bit boundary.
Whether edk2 satisfies that, and if so, how (by chance / by general
build flags), I don't know. The code says,
///
/// 128 bit buffer containing a unique identifier value.
/// Unless otherwise specified, aligned on a 64 bit boundary.
///
typedef struct {
UINT32 Data1;
UINT16 Data2;
UINT16 Data3;
UINT8 Data4[8];
} GUID;
I think there may have been an expectation in "MdePkg/Include/Base.h"
that the supported compilers would automatically ensure the specified
alignment, given the structure definition.
Thanks
Laszlo
next prev parent reply other threads:[~2019-01-07 18:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181214101043.14067-1-takahiro.akashi@linaro.org>
[not found] ` <20181214101043.14067-3-takahiro.akashi@linaro.org>
[not found] ` <eaa42b61-8335-e6f1-87c5-b9be79d32982@gmx.de>
[not found] ` <20181217011626.GC14562@linaro.org>
[not found] ` <84b6f3fd-ed68-a541-7727-69e5392984e6@suse.de>
[not found] ` <20181225083024.GC14405@linaro.org>
2019-01-07 14:09 ` [RESEND PATCH v2 2/6] efi_loader: Initial HII database protocols Leif Lindholm
2019-01-07 18:29 ` Laszlo Ersek [this message]
2019-01-07 19:22 ` Leif Lindholm
2019-01-08 0:28 ` Laszlo Ersek
2019-01-08 9:51 ` Leif Lindholm
2019-01-08 10:07 ` Ard Biesheuvel
2019-01-08 11:55 ` Laszlo Ersek
2019-01-08 15:12 ` Gao, Liming
2019-01-08 15:45 ` Leif Lindholm
2019-01-08 17:15 ` Laszlo Ersek
2019-01-08 15:02 ` Bi, Dandan
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-list 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=7d6fbbff-ca48-588a-6082-bf8b95a7e829@redhat.com \
--to=devel@edk2.groups.io \
/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