On Wed, 10 Sept 2025 at 22:10, H. Peter Anvin <hpa@xxxxxxxxx> wrote: > > On September 9, 2025 11:01:54 PM PDT, Bagas Sanjaya <bagasdotme@xxxxxxxxx> wrote: > >On Tue, Sep 09, 2025 at 08:25:34PM -0700, Randy Dunlap wrote: > >> On 9/9/25 6:57 PM, Bagas Sanjaya wrote: > >> > +.. _pe-coff-entry-point: > >> > + > >> > +PE/COFF entry point > >> > +=================== > >> > + > >> > +When compiled with ``CONFIG_EFI_STUB=y``, the kernel can be executed as a > >> > +regular PE/COFF binary. See Documentation/admin-guide/efi-stub.rst for > >> > +implementation details. > >> > + > >> > +The stub loader can request the initrd via a UEFI protocol. For this to work, > >> > +the firmware or bootloader needs to register a handle which implements the > >> > +``EFI_LOAD_FILE2`` protocol with the ``LINUX_EFI_INITRD_MEDIA_GUID`` device > >> > +path. In this case, a kernel booting via the EFI stub will use the ``LoadFile`` > >> > +function on the registered handle to obtain a reference to the initrd. > >> > >> drivers/firmware/efi/libstub/efi-stub-helper.c (line 509) says LoadFile2 > >> protocol. Is that the same as the LoadFile function? > >> > >> https://github.com/u-boot/u-boot/commit/ec80b4735a593961fe701cc3a5d717d4739b0fd0 > >> (the link below) also says LoadFile2() 4 times (and LoadFile 0 times). > > > >From UEFI spec [1], both LoadFile and LoadFile2 protocol versions of LoadFile() > >function has same prototype but somewhat different in behavior. To answer > >your question, however, I think so. > > > >EFI folks, what are your opinions? > > > >Thanks. > > > >[1]: https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html > > > > Sounds like the code was updated but not the documentation. The UEFI spec defines two protocols, LoadFile and LoadFile2, under two different GUIDs. They differ slightly in behavior when used to boot the OS loader from the boot manager, but are identical when used in other contexts. The protocol definition (i.e., the struct layout) is identical: they both implement a LoadFile() method with the same prototype, So the answer the question: the LoadFile2 *protocol* is not the same as the LoadFile *function*. And to be pedantic, no LoadFile function is defined in the spec. It does define LoadFile::LoadFile() and LoadFile2::LoadFile() protocol methods.