Linux EFI development
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sumit Garg <sumit.garg@linaro.org>,
	Jens Wiklander <jens.wiklander@linaro.org>
Subject: Re: [PATCH 2/3] efi: stmm: Use EFI return code of setup_mm_hdr
Date: Thu, 21 Aug 2025 15:00:13 +0200	[thread overview]
Message-ID: <3a9eb8eb-3420-4232-8259-3b33ed45dc66@siemens.com> (raw)
In-Reply-To: <50f7f2fc-2c6d-4ae1-bbce-e132b1d9c9fe@siemens.com>

On 20.08.25 16:59, Jan Kiszka wrote:
> On 20.08.25 09:10, Ilias Apalodimas wrote:
>> Hi Jan
>>
>> On Fri, 15 Aug 2025 at 22:12, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>>
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> If a too large payload_size is passed to setup_mm_hdr, callers will
>>> returned EFI_OUT_OF_RESOURCES rather than EFI_INVALID_PARAMETER that is
>>> passed down via ret. No need to fold errors here.
>>
>> Apart from not folding the error here, the current code kind of
>> violates the EFI spec.
>> If you look at GetVariable, GetNextVariable, SetVariable, and
>> QueryVariableInfo only SetVariable is supposed to return
>> EFI_OUT_OF_RESOURCES, if there's no storage space left.
> 
> And with storage space is likely meant the persistent part of it. ENOMEM
> is something different.
> 
>>
>> Should we also change setup_mm_hdr() and return EFI_INVALID_PARAMETER
>> always? It's still not ideal, but much closer to the spec.
> 
> EFI_DEVICE_ERROR? The "hardware" is has a problem by not providing us
> enough RAM. Yeah, not optimal either. But invalid parameter is clearly
> described, and nothing fits.
> 

If there are no concerns, I will switch to EFI_DEVICE_ERROR and even
drop the error "ret" argument in v2.

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

  reply	other threads:[~2025-08-21 13:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 19:12 [PATCH 0/3] efi: stmm: Fix for incorrect buffer allocation and cleanups Jan Kiszka
2025-08-15 19:12 ` [PATCH 1/3] efi: stmm: Fix incorrect buffer allocation method Jan Kiszka
2025-08-20  7:29   ` Ilias Apalodimas
2025-08-20 15:05     ` Jan Kiszka
2025-08-21  9:35       ` Sumit Garg
2025-08-21 12:56         ` Jan Kiszka
2025-08-22  9:07           ` Sumit Garg
2025-08-15 19:12 ` [PATCH 2/3] efi: stmm: Use EFI return code of setup_mm_hdr Jan Kiszka
2025-08-20  7:10   ` Ilias Apalodimas
2025-08-20 14:59     ` Jan Kiszka
2025-08-21 13:00       ` Jan Kiszka [this message]
2025-08-21 13:26         ` Ilias Apalodimas
2025-08-15 19:12 ` [PATCH 3/3] efi: stmm: Drop unneeded null pointer check Jan Kiszka
2025-08-20  6:44   ` Ilias Apalodimas

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=3a9eb8eb-3420-4232-8259-3b33ed45dc66@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=ardb@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahisa.kojima@linaro.org \
    --cc=sumit.garg@linaro.org \
    /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