From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH 12/16] efi_loader: optional pointer for ConvertPointer
Date: Tue, 31 Mar 2020 16:51:29 +0900 [thread overview]
Message-ID: <20200331075128.GN11504@linaro.org> (raw)
In-Reply-To: <0f6938d6-e727-eb04-2562-bec01760549f@gmx.de>
On Tue, Mar 31, 2020 at 08:52:23AM +0200, Heinrich Schuchardt wrote:
> On March 31, 2020, 5:23 a.m. UTC Takahiro Akashi wrote
> >On Fri, Mar 27, 2020 at 06:27:56AM +0100, Heinrich Schuchardt wrote:
> >> If the EFI_OPTIONAL_PTR is set in DebugDisposition, a NULL pointer
> does not
> >> constitute an invalid parameter.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >> include/efi_api.h | 2 ++
> >> lib/efi_loader/efi_runtime.c | 6 ++++++
> >> 2 files changed, 8 insertions(+)
> >>
> >> diff --git a/include/efi_api.h b/include/efi_api.h
> >> index 1c40ffc4f5..c56703fc5e 100644
> >> --- a/include/efi_api.h
> >> +++ b/include/efi_api.h
> >> @@ -250,6 +250,8 @@ struct efi_rt_properties_table {
> >> u32 runtime_services_supported;
> >> };
> >>
> >> +#define EFI_OPTIONAL_PTR 0x00000001
> >> +
> >> struct efi_runtime_services {
> >> struct efi_table_hdr hdr;
> >> efi_status_t (EFIAPI *get_time)(struct efi_time *time,
> >> diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
> >> index 67fa693e41..664a0422e2 100644
> >> --- a/lib/efi_loader/efi_runtime.c
> >> +++ b/lib/efi_loader/efi_runtime.c
> >> @@ -511,6 +511,12 @@ efi_convert_pointer(efi_uintn_t
> debug_disposition, void **address)
> >> ret = EFI_INVALID_PARAMETER;
> >> goto out;
> >> }
> >> + if (!*address) {
> >> + if (debug_disposition & EFI_OPTIONAL_PTR)
> >> + return EFI_SUCCESS;
> >> + else
> >> + return EFI_INVALID_PARAMETER;
> >> + }
> >
> >In either case, NULL won't be converted.
> >Is this a behavior UEFI specification expects?
> >(I haven't found any description there.)
> >
> >-Takahiro Akashi
>
>
> The spec has:
>
> EFI_INVALID_PARAMETER - *Address is NULL and DebugDisposition does not
> have the EFI_OPTIONAL_PTR bit set.
That's it.
There is no description about how NULL be handled if OPTIONAL_PTR.
> EFI_OPTIONAL_PTR is handled in the same way in EDK2. An optional pointer
> is one that should not be converted if is NULL. It should stay NULL, so
> that the firmware can detect that it is not set.
Even so, when you implement it based on your own *interpretation,*
you should describe it explicitly.
-Takahiro Akashi
>
> Best regards
>
> Heinrich
>
> >
> >
> >> for (i = 0; i < efi_descriptor_count; i++) {
> >> struct efi_mem_desc *map = (void *)efi_virtmap +
> >> --
> >> 2.25.1
> >>
next prev parent reply other threads:[~2020-03-31 7:51 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 5:27 [PATCH 00/16] efi_loader: non-volatile and runtime variables Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 01/16] cmd: efidebug: fix int to pointer cast Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 02/16] efi_loader: only reserve memory if fdt node enabled Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 03/16] efi_loader: eliminate EFI_CALL() for variable access Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 04/16] part: detect EFI system partition Heinrich Schuchardt
2020-03-27 6:35 ` Punit Agrawal
2020-03-27 7:21 ` Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 05/16] efi_loader: identify " Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 06/16] efi_loader: keep attributes in efi_set_variable_int() Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 07/16] efi_loader: export initialization state Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 08/16] efi_loader: change setup sequence Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 09/16] efi_loader: imply FAT, FAT_WRITE Heinrich Schuchardt
2020-03-31 5:28 ` AKASHI Takahiro
2020-03-31 6:44 ` Heinrich Schuchardt
2020-03-31 7:44 ` AKASHI Takahiro
2020-03-31 8:20 ` Mark Kettenis
2020-04-01 0:31 ` AKASHI Takahiro
2020-04-01 6:43 ` Heinrich Schuchardt
2020-04-01 17:56 ` Mark Kettenis
2020-04-02 1:34 ` AKASHI Takahiro
2020-03-31 13:08 ` Heinrich Schuchardt
2020-03-31 23:57 ` AKASHI Takahiro
2020-04-01 1:14 ` AKASHI Takahiro
2020-04-01 6:31 ` Heinrich Schuchardt
2020-04-01 7:04 ` AKASHI Takahiro
2020-04-02 12:33 ` Ilias Apalodimas
2020-03-27 5:27 ` [PATCH 10/16] efi_loader: UEFI variable persistence Heinrich Schuchardt
2020-03-27 8:07 ` Punit Agrawal
2020-03-27 10:30 ` Heinrich Schuchardt
2020-03-30 10:03 ` Punit Agrawal
2020-04-06 16:06 ` Ilias Apalodimas
2021-01-02 22:15 ` Peter Robinson
2020-03-27 5:27 ` [PATCH 11/16] efi_loader: export efi_convert_pointer() Heinrich Schuchardt
2020-03-27 5:27 ` [PATCH 12/16] efi_loader: optional pointer for ConvertPointer Heinrich Schuchardt
2020-03-31 5:23 ` AKASHI Takahiro
2020-03-31 6:52 ` Heinrich Schuchardt
2020-03-31 7:51 ` AKASHI Takahiro [this message]
2020-03-27 5:27 ` [PATCH 13/16] efi_loader: memory buffer for variables Heinrich Schuchardt
2020-03-27 8:09 ` Punit Agrawal
2020-03-27 10:45 ` Heinrich Schuchardt
2020-03-30 10:50 ` Punit Agrawal
2020-03-27 5:27 ` [PATCH 14/16] efi_loader: use memory based variable storage Heinrich Schuchardt
2020-03-27 19:44 ` [PATCH 00/16] efi_loader: non-volatile and runtime variables Simon Glass
2020-03-28 6:42 ` Heinrich Schuchardt
2020-03-31 6:05 ` [PATCH 15/16] efi_loader: enable UEFI variables at runtime Heinrich Schuchardt
2020-03-31 6:05 ` [PATCH 15/16] efi_selftest: adjust runtime test for variables Heinrich Schuchardt
2020-04-01 1:41 ` [PATCH 15/16] efi_loader: enable UEFI variables at runtime AKASHI Takahiro
2020-04-01 6:26 ` Heinrich Schuchardt
2020-04-01 6:51 ` AKASHI Takahiro
2020-03-31 6:07 ` [PATCH 16/16] efi_selftest: adjust runtime test for variables Heinrich Schuchardt
2020-04-01 1:05 ` AKASHI Takahiro
2020-04-01 6:37 ` Heinrich Schuchardt
2020-04-01 7:27 ` AKASHI Takahiro
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=20200331075128.GN11504@linaro.org \
--to=takahiro.akashi@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