Hi Jeff,

I see.  I missed the file rename line in the git patch.

I think the description needs to be expanded to clearly describe the production 
and consumption of this device path with this GUID.


  1.  What component creates the UEFI handle with the Device Path Protocol and 
the LoadFile2 Protocol with the initrd image?  Is it the platform FW or the OS 
Loader?  If it is the platform FW, then how does the platform FW know which 
initrd image to publish if there are multiple Linux OSes installed?
  2.  What component locates the UEFI handle with the Device Path Protocol and 
the LoadFile2 Protocol with the initrd image?  It is another stage of the OS 
Loader or the OS Kernel?  Given that these handles are only available before 
ExitBootServices, I think this means that the component that locates the initrd 
image has to do so before ExitBootServices is called.

Thanks,

Mike

From: Jeff Brasen <jbra...@nvidia.com>
Sent: Wednesday, July 21, 2021 10:26 AM
To: Kinney, Michael D <michael.d.kin...@intel.com>; Ard Biesheuvel 
<a...@kernel.org>
Cc: devel@edk2.groups.io; ardb+tianoc...@kernel.org; Justen, Jordan L 
<jordan.l.jus...@intel.com>; gaolim...@byosoft.com.cn; Liu, Zhiguang 
<zhiguang....@intel.com>; Samer El-Haj-Mahmoud <samer.el-haj-mahm...@arm.com>
Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of 
LINUX_EFI_INITRD_MEDIA_GUID

Does this look good for text to add

"Linux distro boot generally relies on an initial ramdisk (initrd)
which is provided by the loader, and which contains additional kernel
modules (for storage and network, for instance), and the initial user
space startup code, i.e., the code which brings up the user space side
of the entire OS.

In order to provide a standard method to locate this file,
the GUID defined in this file is used to describe the device path
for a LoadFile2 Protocol instance that is responsible for loading the initrd 
file"


Also, the patch does have
 {OvmfPkg => MdePkg}/Include/Guid/LinuxEfiInitrdMedia.h | 0
 3 files changed, 5 insertions(+), 1 deletion(-)
 rename {OvmfPkg => MdePkg}/Include/Guid/LinuxEfiInitrdMedia.h (100%)
[snip]
diff --git a/OvmfPkg/Include/Guid/LinuxEfiInitrdMedia.h 
b/MdePkg/Include/Guid/LinuxEfiInitrdMedia.h
similarity index 100%
rename from OvmfPkg/Include/Guid/LinuxEfiInitrdMedia.h
rename to MdePkg/Include/Guid/LinuxEfiInitrdMedia.h



Thanks,

Jeff

________________________________
From: Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Sent: Wednesday, July 21, 2021 9:38 AM
To: Jeff Brasen <jbra...@nvidia.com<mailto:jbra...@nvidia.com>>; Ard Biesheuvel 
<a...@kernel.org<mailto:a...@kernel.org>>; Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
<devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; 
ardb+tianoc...@kernel.org<mailto:ardb+tianoc...@kernel.org> 
<ardb+tianoc...@kernel.org<mailto:ardb+tianoc...@kernel.org>>; Justen, Jordan L 
<jordan.l.jus...@intel.com<mailto:jordan.l.jus...@intel.com>>; 
gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn> 
<gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn>>; Liu, Zhiguang 
<zhiguang....@intel.com<mailto:zhiguang....@intel.com>>; Samer El-Haj-Mahmoud 
<samer.el-haj-mahm...@arm.com<mailto:samer.el-haj-mahm...@arm.com>>
Subject: RE: [edk2-devel] [PATCH 1/1] MdePkg: add definition of 
LINUX_EFI_INITRD_MEDIA_GUID

External email: Use caution opening links or attachments


Hi Ard,



If this device path node is considered as part of the standard interface 
between the Linux kernel and

firmware, then it does make sense for it to be in the MdePkg.  We usually try 
to reference a public

specification in the include file that defines the interface.



In this case, since there is no public document, but it is part of the Linux 
kernel assumptions,

can the include file for the GUID provide pointers to the Linux kernel that 
uses the GUID and

describe how the GUID is produced by the FW and consumed by the Linux kernel?



I also see that this patch appears to be incomplete.  There is an 
OvmfPkg/Include/Guid/LinuxEfiInitrdMedia.h

file in the OvmfPkg.  Shouldn’t that file also be moved to the MdePkg as part 
of this patch?



Thanks,



Mike



From: Jeff Brasen <jbra...@nvidia.com<mailto:jbra...@nvidia.com>>
Sent: Tuesday, July 20, 2021 9:59 AM
To: Ard Biesheuvel <a...@kernel.org<mailto:a...@kernel.org>>; Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
ardb+tianoc...@kernel.org<mailto:ardb+tianoc...@kernel.org>; Justen, Jordan L 
<jordan.l.jus...@intel.com<mailto:jordan.l.jus...@intel.com>>; 
gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn>; Liu, Zhiguang 
<zhiguang....@intel.com<mailto:zhiguang....@intel.com>>; Samer El-Haj-Mahmoud 
<samer.el-haj-mahm...@arm.com<mailto:samer.el-haj-mahm...@arm.com>>
Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of 
LINUX_EFI_INITRD_MEDIA_GUID



In my opinion MdePkg is where this should be as it is meant to be used by 
multiple software entities (linux kernel, grub, edk2, coreboot w/ uefi binding) 
and probably should be documented in some spec (Although, I am not sure which 
one would make sense)



I am fine with MdeModulePkg as well though.



Thanks,

Jeff

________________________________

From: Ard Biesheuvel <a...@kernel.org<mailto:a...@kernel.org>>
Sent: Friday, July 16, 2021 9:56 AM
To: Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: Jeff Brasen <jbra...@nvidia.com<mailto:jbra...@nvidia.com>>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
<devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; 
ardb+tianoc...@kernel.org<mailto:ardb+tianoc...@kernel.org> 
<ardb+tianoc...@kernel.org<mailto:ardb+tianoc...@kernel.org>>; Justen, Jordan L 
<jordan.l.jus...@intel.com<mailto:jordan.l.jus...@intel.com>>; 
gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn> 
<gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn>>; Liu, Zhiguang 
<zhiguang....@intel.com<mailto:zhiguang....@intel.com>>; Samer El-Haj-Mahmoud 
<samer.el-haj-mahm...@arm.com<mailto:samer.el-haj-mahm...@arm.com>>
Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of 
LINUX_EFI_INITRD_MEDIA_GUID



External email: Use caution opening links or attachments


On Fri, 16 Jul 2021 at 17:00, Kinney, Michael D
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>> wrote:
>
> Hi Ard,
>
> I see you were involved in the OS side changes.
>
> Can you explain what is required for the FW <-> OS interface with respect to 
> Load File Protocol and this media device path node.
>
> What happens if this media device path node is not present?  What breaks?
>
> Trying to figure out if this is a required interop feature (MdePkg candidate) 
> or an EDK II specific extension (MdeModulePkg candidate).
>

Let me give some context first:

Linux distro boot generally relies on an initial ramdisk (initrd)
which is provided by the loader, and which contains additional kernel
modules (for storage and netwerk, for instance), and the initial user
space startup code, ie., the code which brings up the user space side
of the entire OS.

Before we introduced this media path, the only way for a EFI pre-OS
loader (such as GRUB) to provide this initrd was to copy it into DRAM
somewhere, and use a arch-specific method of passing the DRAM address
and size to the OS (x86 uses struct bootparam, whereas ARM uses device
tree). It also requires knowledge on the part of GRUB regarding which
parts of DRAM are suitable for holding an initrd image. For measured
boot scenarios, it may be an advantage not to have the initrd linger
in DRAM for longer that necessary, and we actually intend to measure
the initrd loaded via the new method right after it has been loaded
this way.

To avoid extending this to other architectures such as RISC-V, I
decided to introduce a special vendor media path for Linux initrd
images, which GRUB et al can implement, which provides the initrd
image when the OS loader that consumes it asks for it.

So for Linux on x86 or ARM, this is optional, given that support for
the old method is not going away any time soon. For RISC-V, I
suggested that only the new method be implemented, but I am not sure
what the status is there. Note that many embedded style systems don't
use GRUB, and may not use initrds to begin with. OTOH, U-Boot also
implements support for the Linux initrd vendor media path, and work is
ongoing to add measured boot support as well.

In any case, I don't have a strong preference where this should live,
as long as it is in a generic place where all architectures can use
it.

--
Ard.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78039): https://edk2.groups.io/g/devel/message/78039
Mute This Topic: https://groups.io/mt/84231808/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to