public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: u-boot@lists.denx.de, git@amd.com,
	Shantur Rathore <i@shantur.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	"Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
Subject: Re: [PATCH v5 1/3] efi_var_file: refactor to move buffer functions
Date: Fri, 30 Jan 2026 10:10:47 +0100	[thread overview]
Message-ID: <8babb792-e277-4319-9f65-76263ca25d19@amd.com> (raw)
In-Reply-To: <CAC_iWj+dvScrzUYvWP=aeqr9wJAjL0CU6atnAm98F+SL2C_TBg@mail.gmail.com>



On 1/30/26 08:39, Ilias Apalodimas wrote:
> Hi Michal,
> 
> Thanks for following up on this
> 
> 
>>    * efi_var_restore() - restore EFI variables from buffer
>>    *
>> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
>> index f490081f6542..ca1775eb03be 100644
>> --- a/lib/efi_loader/Makefile
>> +++ b/lib/efi_loader/Makefile
>> @@ -53,7 +53,7 @@ ifeq ($(CONFIG_EFI_MM_COMM_TEE),y)
>>   obj-y += efi_variable_tee.o
>>   else
>>   obj-y += efi_variable.o
>> -obj-y += efi_var_file.o
>> +obj-$(CONFIG_EFI_VARIABLE_FILE_STORE) += efi_var_file.o
> 
> hrmm what if we compile with EFI_VARIABLE_NO_STORE?

What's the concern here?

efi_var_to_file/efi_var_from_file() are just defined in efi_var_file.c

But that functions are never called from efi_variable.c

        if (attributes & EFI_VARIABLE_NON_VOLATILE) {
                if (IS_ENABLED(CONFIG_EFI_VARIABLE_NO_STORE))
                        return EFI_NOT_READY;

                 efi_var_to_file();

I mean undefined reference to efi_var_to_file() is there but because there is 
return above function is unreachable and compiler just removes it.


> 
>> diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
>> index f3533f4def3a..13db6eae882a 100644
>> --- a/lib/efi_loader/efi_variable.c
>> +++ b/lib/efi_loader/efi_variable.c
>> @@ -397,11 +397,15 @@ efi_status_t efi_set_variable_int(const u16 *variable_name,
>>                  ret = EFI_SUCCESS;
>>
>>          /*
>> -        * Write non-volatile EFI variables to file
>> +        * Write non-volatile EFI variables
>>           * TODO: check if a value change has occured to avoid superfluous writes
>>           */
>> -       if (attributes & EFI_VARIABLE_NON_VOLATILE)
>> +       if (attributes & EFI_VARIABLE_NON_VOLATILE) {
>> +               if (IS_ENABLED(CONFIG_EFI_VARIABLE_NO_STORE))
>> +                       return EFI_NOT_READY;
> 
> I think we should just return success here. EFI_VARIABLE_NO_STORE
> means "dont store on file, but we still have to update the memory
> backend.

Yes before this patch EFI_SUCCESS was returned. Will fix.

Thanks,
Michal




  reply	other threads:[~2026-01-30  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 14:17 [PATCH v5 0/3] efi_vars: Implement SPI Flash storage for EFI Michal Simek
2026-01-23 14:17 ` [PATCH v5 1/3] efi_var_file: refactor to move buffer functions Michal Simek
2026-01-30  7:39   ` Ilias Apalodimas
2026-01-30  9:10     ` Michal Simek [this message]
2026-01-23 14:17 ` [PATCH v5 2/3] efi_var: Unify read/write access helper function Michal Simek
2026-01-30  7:43   ` Ilias Apalodimas
2026-01-23 14:17 ` [PATCH v5 3/3] efi_vars: Implement SPI Flash store Michal Simek

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=8babb792-e277-4319-9f65-76263ca25d19@amd.com \
    --to=michal.simek@amd.com \
    --cc=git@amd.com \
    --cc=i@shantur.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=paul.liu@linaro.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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