Hi Ilias,

El mié, 19 mar 2025 a las 6:32, Ilias Apalodimas (<
ilias.apalodi...@linaro.org>) escribió:

> Hi Adriano,
>
> [...]
>
> >   */
> >  static efi_status_t efi_binary_run_dp(void *image, size_t size, void
> *fdt,
> > +                                     void *initrd, size_t initd_sz,
> >                                       struct efi_device_path *dp_dev,
> >                                       struct efi_device_path *dp_img)
> >  {
> >         efi_status_t ret;
> > +       struct efi_device_path *dp_initrd;
> >
> >         /* Initialize EFI drivers */
> >         ret = efi_init_obj_list();
> > @@ -230,6 +234,14 @@ static efi_status_t efi_binary_run_dp(void *image,
> size_t size, void *fdt,
> >         if (ret != EFI_SUCCESS)
> >                 return ret;
> >
> > +       dp_initrd = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
> (uintptr_t)initrd, initd_sz);
>
> Why do we need reserved memory? What the EFI stub does, is allocate a
> new memory buffer which you later copy the initrd to.
> I think Boot Services Data is enough.
>

dp_initrd is freed when the efi application returns in
efi_initrd_deregister. Do you suggest to change it to
Boot Sevices Data and when the efi application returns just assume that it
is freed? I took the usage from:
https://github.com/u-boot/u-boot/blob/8bc3542384e3a1219e5ffb62b79d16dddc1b1fb9/lib/efi_loader/efi_bootmgr.c#L514


>
> [...]
>
> Thanks
> /Ilias
>

Reply via email to