From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH 2/5 v2] efi_loader: Implement EFI variable handling via OP-TEE
Date: Wed, 13 May 2020 11:10:31 +0300 [thread overview]
Message-ID: <20200513081031.GA100468@apalos.home> (raw)
In-Reply-To: <826c3b50-5115-855a-128e-37f000faf7b0@gmx.de>
On Wed, May 13, 2020 at 08:14:19AM +0200, Heinrich Schuchardt wrote:
> On 5/11/20 8:14 PM, Ilias Apalodimas wrote:
> > In OP-TEE we can run EDK2's StandAloneMM on a secure partition.
> > StandAloneMM is responsible for the UEFI variable support. In
> > +
[...]
> > + EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, guid);
> > +
> > + if (!variable_name_size || !variable_name || !guid)
> > + return EFI_EXIT(EFI_INVALID_PARAMETER);
> > +
> > + out_name_size = *variable_name_size;
> > + in_name_size = u16_strsize(variable_name);
>
> The UEFI spec requires that EFI_INVALID_PARAMETER should be returned if
> there is no '\0' character in the first *variable_name_size words of
> variable_name. I think we should add this test here instead of using
> max(out_name_size, in_name_size) later in the code.
Ok I'll have a look
>
> You are currently calling EFI_EXIT() in many places. Depending on the
> level of code optimizations done by the compiler and the debug settings
> this may need to unnecessary code size. I suggest to use a single exit
> point in each of the functions, e.g.
>
> if (out_name_size > in_name_size) {
> ret = EFI_INVALID_PARAMETER;
> goto out;
> }
> ...
> out:
> EFI_EXIT(ret);
Fair enough, most of U-Boot is coded that way anyway, might as well have a
common approach.
I'll post a v3 with the changes, so you can do your testing directly in that
Regards
/Ilias
next prev parent reply other threads:[~2020-05-13 8:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 18:13 [PATCH 0/6 v2] EFI variable support via OP-TEE Ilias Apalodimas
2020-05-11 18:13 ` [PATCH 1/5 v2] efi_loader: Add headers for EDK2 StandAloneMM communication Ilias Apalodimas
2020-05-11 19:39 ` Heinrich Schuchardt
2020-05-12 4:15 ` Ilias Apalodimas
2020-05-12 4:34 ` Ilias Apalodimas
2020-05-11 18:14 ` [PATCH 2/5 v2] efi_loader: Implement EFI variable handling via OP-TEE Ilias Apalodimas
2020-05-13 6:14 ` Heinrich Schuchardt
2020-05-13 8:10 ` Ilias Apalodimas [this message]
2020-05-15 11:55 ` Heinrich Schuchardt
2020-05-15 12:08 ` Ilias Apalodimas
2020-05-11 18:14 ` [PATCH 3/5 v2] cmd: efidebug: Add support for querying UEFI variable storage Ilias Apalodimas
2020-05-11 18:54 ` Heinrich Schuchardt
2020-05-12 4:02 ` Ilias Apalodimas
2020-05-11 18:14 ` [PATCH 4/5 v2] MAINTAINERS: Add maintainer for EFI variables via OP-TEE Ilias Apalodimas
2020-05-11 18:39 ` Heinrich Schuchardt
2020-05-11 18:14 ` [PATCH 5/5 v2] doc: uefi.rst: Add OP-TEE variable storage config options Ilias Apalodimas
2020-05-11 18:38 ` Heinrich Schuchardt
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=20200513081031.GA100468@apalos.home \
--to=ilias.apalodimas@linaro.org \
--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