From: ilias.apalodimas at linaro.org Date: Tue, 7 Jul 2020 16:10:52 +0300 Subject: [PATCH v2 16/17] efi_loader: enable UEFI variables at runtime In-Reply-To: <20200707031200.65511-17-xypron.glpk@gmx.de> References: <20200707031200.65511-1-xypron.glpk@gmx.de> <20200707031200.65511-17-xypron.glpk@gmx.de> Message-ID: <20200707131052.GA14600@apalos.home> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jul 07, 2020 at 05:11:59AM +0200, Heinrich Schuchardt wrote: > Enable UEFI variables at runtime. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_runtime.c | 2 ++ > lib/efi_loader/efi_variable.c | 6 ++++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c > index 5b6506fbdc..91a4551448 100644 > --- a/lib/efi_loader/efi_runtime.c > +++ b/lib/efi_loader/efi_runtime.c > @@ -121,6 +121,8 @@ efi_status_t efi_init_runtime_supported(void) > rt_table->version = EFI_RT_PROPERTIES_TABLE_VERSION; > rt_table->length = sizeof(struct efi_rt_properties_table); > rt_table->runtime_services_supported = > + EFI_RT_SUPPORTED_GET_VARIABLE | > + EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME | > EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP | > EFI_RT_SUPPORTED_CONVERT_POINTER; > > diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c > index 13123e7e41..c472a054d0 100644 > --- a/lib/efi_loader/efi_variable.c > +++ b/lib/efi_loader/efi_variable.c > @@ -672,7 +672,8 @@ static efi_status_t __efi_runtime EFIAPI > efi_get_variable_runtime(u16 *variable_name, const efi_guid_t *vendor, > u32 *attributes, efi_uintn_t *data_size, void *data) > { > - return EFI_UNSUPPORTED; > + return efi_get_variable_int(variable_name, vendor, attributes, > + data_size, data, NULL); > } > > /** > @@ -688,7 +689,8 @@ static efi_status_t __efi_runtime EFIAPI > efi_get_next_variable_name_runtime(efi_uintn_t *variable_name_size, > u16 *variable_name, efi_guid_t *vendor) > { > - return EFI_UNSUPPORTED; > + return efi_get_next_variable_name_int(variable_name_size, variable_name, > + vendor); Since we use the internal functions for the variables, don't we include the EFI_VARIABLE_READ_ONLY bit as well (which is different on the tee based version). Wouldn't it be better to just remove the runtime variant completely? Thanks /Ilias > } > > /** > -- > 2.27.0 >