[PATCH v5 5/9] efi: Drop the memset() from efi_alloc()

Simon Glass sjg at chromium.org
Tue Dec 3 01:23:07 CET 2024


Hi Tom,

On Mon, 2 Dec 2024 at 15:01, Tom Rini <trini at konsulko.com> wrote:
>
> On Sun, Dec 01, 2024 at 08:28:07AM -0700, Simon Glass wrote:
>
> > From my inspection none of the users need the memory to be zeroed. It
> > is somewhat unexpected that it does so, since the name gives no clue to
> > this.
> >
> > Drop the memset() so that it effectively becomes a wrapper around the
> > normal EFI-pool allocator.
> >
> > Another option would be to drop this function and call
> > efi_allocate_pool() directly, but that increase code size a little.
> >
> > Move the function comment to the header file like most other exported
> > functions in U-Boot.
> >
> > Comments were made in v3 that another project uses memset() when
> > allocating memory, but that is not required by the spec. In any case, as
> > above, from inspection, none of the users need the memory to be zeroed,
> > as they fill the entire region with their own data.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
>
> I thought you agreed to drop this because Heinrich or Ilias was saying
> they'd get the spec clarified to say it should be zeroed?

The other option is to put a 'z' on the end. Heinrich mentioned that
Tianocore zeros memory in an equivalent call, but that doesn't make
any sense to me, sorry. At present I suspect we are masking bugs, but
it's hard to be sure. I'll figure it out eventually, I suspect....

Regards,
Simon


More information about the U-Boot mailing list