[PATCH 05/12] efi_loader: move runtime GetVariable() helpers to efi_variable.c

Simon Glass sjg at chromium.org
Tue Apr 28 20:25:33 CEST 2026


Hi Harsimran,

On 2026-04-24T17:31:50, Harsimran Singh Tungal
<harsimransingh.tungal at arm.com> wrote:
> efi_loader: move runtime GetVariable() helpers to efi_variable.c
>
> Consolidate runtime GetVariable helpers to avoid duplicates
>
> The functions efi_get_variable_runtime() and
> efi_get_next_variable_name_runtime() were implemented in
> efi_variable_tee.c as part of the FF-A runtime variable handling work.
> However, default implementations for these same runtime helpers also
> exist in efi_var_common.c. This results in duplicate symbol definitions.
> To resolve the conflict and centralize the runtime API, this patch moves
> the default implementations of the two runtime GetVariable() helpers
> from efi_var_common.c to efi_variable.c. This ensures that:
>
>  - only a single definition of each runtime helper exists,
>  - backend-specific implementations can override these cleanly,
>  - the EFI runtime variable service table continues to reference the
>    correct functions.
>
> No functional changes are introduced; this is a structural cleanup to
> avoid build-time conflicts and consolidate EFI runtime variable support
> [...]
>
> lib/efi_loader/efi_var_common.c | 24 ------------------------
>  lib/efi_loader/efi_variable.c   | 24 ++++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 24 deletions(-)

> diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
> @@ -579,6 +579,30 @@ efi_set_variable_runtime(u16 *variable_name, const efi_guid_t *vendor,
> +efi_status_t __efi_runtime EFIAPI
> +efi_get_variable_runtime(u16 *variable_name, const efi_guid_t *guid,
> +                      u32 *attributes, efi_uintn_t *data_size, void *data)

Just to clarify the commit message: this is a relocation, not pure
deduplication. efi_var_common.c is always built, while efi_variable.c
is only built when CONFIG_EFI_MM_COMM_TEE is unset, so the move is
what actually resolves the conflict with the new efi_variable_tee.c
definitions. Please reword to make that clear, and drop 'default
implementations for these same runtime helpers also exist in
efi_var_common.c. This results in duplicate symbol definitions' -
there is no duplicate today; the duplicate is what patches 3 and 4
introduce earlier in this series, right?

>     efi_loader: move runtime GetVariable() helpers to efi_variable.c
>
>     Consolidate runtime GetVariable helpers to avoid duplicates

The subject and the one-line summary mention only GetVariable(), but
efi_get_next_variable_name_runtime() is also moved. Please broaden the
wording e.g. 'move runtime variable read helpers'.

Regards,
Simon


More information about the U-Boot mailing list