<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 21 Jul 2021 at 20:04, Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">







<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_2152091238747558005WordSection1">
<p class="MsoNormal"><span>Hi Jeff,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>I see.<span> 
</span>I missed the file rename line in the git patch.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>I think the description needs to be expanded to clearly describe the production and consumption of this device path with this
 GUID.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="gmail-m_2152091238747558005MsoListParagraph" style="margin-left:0in"><span>What component creates the UEFI handle with the Device Path Protocol
 and the LoadFile2 Protocol with the <span class="gmail-m_2152091238747558005SpellE">initrd</span> image?<span> 
</span>Is it the platform FW or the OS Loader?<span>  </span>
If it is the platform FW, then how does the platform FW know which <span class="gmail-m_2152091238747558005SpellE">
initrd</span> image to publish if there are multiple Linux OSes installed?</span></li></ol></div></div></blockquote><div><br></div><div>This is really the firmware/loader's problem. In the ARM / RISC-V world, the distinction between firmware and pre-OS loader is not as clear cut, and for instance, U-boot in EFI mode can either boot the kernel directly (and expose the initrd via this method), or invoke GRUB as an EFI app using LoadImage/StartImage, in which case GRUB can load the kernel and/or initrd via whichever interface it desires.</div><div><br></div><div>It is therefore also the platform FW's problem to decide which initrd goes with which kernel - it is highly platform dependent whether a certain initrd is compatible with only a single kernel, or can be combined with any kernel (e.g., when the kernel has all drivers builtin, and the initrd only contains the user space)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US" style="overflow-wrap: break-word;"><div class="gmail-m_2152091238747558005WordSection1"><ol style="margin-top:0in" start="1" type="1"><li class="gmail-m_2152091238747558005MsoListParagraph" style="margin-left:0in"><span><u></u><u></u></span></li><li class="gmail-m_2152091238747558005MsoListParagraph" style="margin-left:0in"><span>What component locates the UEFI handle with the Device Path Protocol
 and the LoadFile2 Protocol with the <span class="gmail-m_2152091238747558005SpellE">initrd</span> image?<span> 
</span>It is another stage of the OS Loader or the OS Kernel?<span> 
</span>Given that these handles are only available before <span class="gmail-m_2152091238747558005SpellE">ExitBootServices</span>, I think this means that the component that locates the
<span class="gmail-m_2152091238747558005SpellE">initrd</span> image has to do so before <span class="gmail-m_2152091238747558005SpellE">
ExitBootServices</span> is called.<u></u><u></u></span></li></ol>
<p class="MsoNormal"><span><u></u> </span></p></div></div></blockquote><div><br></div><div>The consumer of the protocol is the EFI stub loader in Linux, i.e., the OS loader that is built into the OS kernel. It is the agent that calls ExitBootServices(), and it indeed consumes the protocol beforehand.</div><div><br></div><div>In summary, I think it should be sufficient to describe the consumer's expectations with respect to the API. I don't think it makes sense to be normative about how platform firmware or intermediate loaders keep track of which file to expose, as long as it complies with the consumer's requirements.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US" style="overflow-wrap: break-word;"><div class="gmail-m_2152091238747558005WordSection1"><div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt"><div><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal"><span>
<b>To:</b> Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>>; Ard Biesheuvel <<a href="mailto:ardb@kernel.org" target="_blank">ardb@kernel.org</a>><br>
<b>Cc:</b> <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>; <a href="mailto:ardb%2Btianocore@kernel.org" target="_blank">ardb+tianocore@kernel.org</a>; Justen, Jordan L <<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>>; <a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a>; Liu, Zhiguang <<a href="mailto:zhiguang.liu@intel.com" target="_blank">zhiguang.liu@intel.com</a>>; Samer El-Haj-Mahmoud <<a href="mailto:Samer.El-Haj-Mahmoud@arm.com" target="_blank">Samer.El-Haj-Mahmoud@arm.com</a>><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black">Does this look good for text to add<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black">"</span><span style="color:black;background:white">Linux distro boot generally relies on an initial ramdisk (initrd)</span><span style="font-size:12pt;color:black"><br>
</span><span style="color:black;background:white">which is provided by the loader, and which contains additional kernel</span><span style="color:black"><br>
<span style="background:white">modules (for storage and network, for instance), and the initial user</span><br>
<span style="background:white">space startup code, i.e., the code which brings up the user space side</span><br>
<span style="background:white">of the entire OS.<br>
</span></span><span style="font-size:12pt;color:black"><br>
In order to provide a standard method to locate this file,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black">the GUID defined in this file is used to describe the device path<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black">for a LoadFile2 Protocol instance that is responsible for loading the initrd file"<u></u><u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black">Also, the patch does have<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:rgb(32,31,30);background:white"> {OvmfPkg => MdePkg}/Include/Guid/LinuxEfiInitrdMedia.h | 0</span><span style="font-size:12pt;color:black"><br>
</span><span style="font-family:"Segoe UI",sans-serif;color:rgb(32,31,30);background:white"> 3 files changed, 5 insertions(+), 1 deletion(-)</span><span style="font-family:"Segoe UI",sans-serif;color:rgb(32,31,30)"><br>
<span style="background:white"> rename {OvmfPkg => MdePkg}/Include/Guid/LinuxEfiInitrdMedia.h (100%)</span><br>
</span><span style="font-size:12pt;color:black">[snip]</span><span style="font-family:"Segoe UI",sans-serif;color:rgb(32,31,30)"><br>
<span style="background:white">diff --git a/OvmfPkg/Include/Guid/LinuxEfiInitrdMedia.h b/MdePkg/Include/Guid/LinuxEfiInitrdMedia.h</span><br>
<span style="background:white">similarity index 100%</span><br>
<span style="background:white">rename from OvmfPkg/Include/Guid/LinuxEfiInitrdMedia.h</span><br>
<span style="background:white">rename to MdePkg/Include/Guid/LinuxEfiInitrdMedia.h</span></span><span style="font-size:12pt;color:black"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;color:black"><u></u> <u></u></span></p>
</div>
<div id="gmail-m_2152091238747558005Signature">
<div>
<p>Thanks,<u></u><u></u></p>
<p>Jeff<u></u><u></u></p>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span>
<hr size="2" width="98%" align="center">
</span></div>
<div id="gmail-m_2152091238747558005divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>><br>
<b>Sent:</b> Wednesday, July 21, 2021 9:38 AM<br>
<b>To:</b> Jeff Brasen <<a href="mailto:jbrasen@nvidia.com" target="_blank">jbrasen@nvidia.com</a>>; Ard Biesheuvel <<a href="mailto:ardb@kernel.org" target="_blank">ardb@kernel.org</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>><br>
<b>Cc:</b> <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>>;
<a href="mailto:ardb+tianocore@kernel.org" target="_blank">ardb+tianocore@kernel.org</a> <<a href="mailto:ardb+tianocore@kernel.org" target="_blank">ardb+tianocore@kernel.org</a>>; Justen, Jordan L <<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>>;
<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a> <<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a>>; Liu, Zhiguang <<a href="mailto:zhiguang.liu@intel.com" target="_blank">zhiguang.liu@intel.com</a>>; Samer El-Haj-Mahmoud <<a href="mailto:Samer.El-Haj-Mahmoud@arm.com" target="_blank">Samer.El-Haj-Mahmoud@arm.com</a>><br>
<b>Subject:</b> RE: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID</span><span>
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span> <u></u><u></u></span></p>
</div>
</div>
<div>
<table border="1" cellspacing="3" cellpadding="0" style="background:rgb(255,235,156)">
<tbody>
<tr>
<td style="padding:0.75pt">
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:Verdana,sans-serif;color:black">External email: Use caution opening links or attachments</span></b><span style="font-size:7.5pt;font-family:Verdana,sans-serif;color:black">
</span><span><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div>
<div>
<p class="gmail-m_2152091238747558005xmsonormal">Hi Ard,<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">If this device path node is considered as part of the standard interface between the Linux kernel and
<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">firmware, then it does make sense for it to be in the <span class="gmail-m_2152091238747558005xspelle">
MdePkg</span>.  We usually try to reference a public<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">specification in the include file that defines the interface.<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">In this case, since there is no public document, but it is part of the Linux kernel assumptions,<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">can the include file for the GUID provide pointers to the Linux kernel that uses the GUID and<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">describe how the GUID is produced by the FW and consumed by the Linux kernel?<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">I also see that this patch appears to be incomplete.  There is an
<span class="gmail-m_2152091238747558005xspelle">OvmfPkg</span>/Include/<span class="gmail-m_2152091238747558005xspelle">Guid</span>/<span class="gmail-m_2152091238747558005xspelle">LinuxEfiInitrdMedia.h</span><u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">file in the <span class="gmail-m_2152091238747558005xspelle">OvmfPkg</span>.  Shouldn’t that file also be moved to the
<span class="gmail-m_2152091238747558005xspelle">MdePkg</span> as part of this patch?<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">Thanks,<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal">Mike<u></u><u></u></p>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="gmail-m_2152091238747558005xmsonormal"><b>From:</b> Jeff Brasen <<a href="mailto:jbrasen@nvidia.com" target="_blank">jbrasen@nvidia.com</a>>
<br>
<b>Sent:</b> Tuesday, July 20, 2021 9:59 AM<br>
<b>To:</b> Ard Biesheuvel <<a href="mailto:ardb@kernel.org" target="_blank">ardb@kernel.org</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>><br>
<b>Cc:</b> <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>; <a href="mailto:ardb+tianocore@kernel.org" target="_blank">
ardb+tianocore@kernel.org</a>; Justen, Jordan L <<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>>;
<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a>; Liu, Zhiguang <<a href="mailto:zhiguang.liu@intel.com" target="_blank">zhiguang.liu@intel.com</a>>; Samer El-Haj-Mahmoud <<a href="mailto:Samer.El-Haj-Mahmoud@arm.com" target="_blank">Samer.El-Haj-Mahmoud@arm.com</a>><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID<u></u><u></u></p>
</div>
</div>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
<div>
<p class="gmail-m_2152091238747558005xmsonormal"><span style="font-size:12pt;color:black">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)</span><u></u><u></u></p>
</div>
<div>
<p class="gmail-m_2152091238747558005xmsonormal"><span style="font-size:12pt;color:black"> </span><u></u><u></u></p>
</div>
<div>
<p class="gmail-m_2152091238747558005xmsonormal"><span style="font-size:12pt;color:black">I am fine with MdeModulePkg as well though.</span><u></u><u></u></p>
</div>
<div>
<div>
<p class="gmail-m_2152091238747558005xmsonormal"><span style="font-size:12pt;color:black"> </span><u></u><u></u></p>
</div>
<div id="gmail-m_2152091238747558005x_Signature">
<div>
<p>Thanks,<u></u><u></u></p>
<p>Jeff<u></u><u></u></p>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span>
<hr size="1" width="98%" align="center">
</span></div>
<div id="gmail-m_2152091238747558005x_divRplyFwdMsg">
<p class="gmail-m_2152091238747558005xmsonormal"><b><span style="color:black">From:</span></b><span style="color:black"> Ard Biesheuvel <<a href="mailto:ardb@kernel.org" target="_blank">ardb@kernel.org</a>><br>
<b>Sent:</b> Friday, July 16, 2021 9:56 AM<br>
<b>To:</b> Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>><br>
<b>Cc:</b> Jeff Brasen <<a href="mailto:jbrasen@nvidia.com" target="_blank">jbrasen@nvidia.com</a>>;
<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>>;
<a href="mailto:ardb+tianocore@kernel.org" target="_blank">ardb+tianocore@kernel.org</a> <<a href="mailto:ardb+tianocore@kernel.org" target="_blank">ardb+tianocore@kernel.org</a>>; Justen, Jordan L <<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>>;
<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a> <<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a>>; Liu, Zhiguang <<a href="mailto:zhiguang.liu@intel.com" target="_blank">zhiguang.liu@intel.com</a>>; Samer El-Haj-Mahmoud <<a href="mailto:Samer.El-Haj-Mahmoud@arm.com" target="_blank">Samer.El-Haj-Mahmoud@arm.com</a>><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID</span>
<u></u><u></u></p>
<div>
<p class="gmail-m_2152091238747558005xmsonormal"> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="gmail-m_2152091238747558005xmsonormal">External email: Use caution opening links or attachments<br>
<br>
<br>
On Fri, 16 Jul 2021 at 17:00, Kinney, Michael D<br>
<<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>> wrote:<br>
><br>
> Hi Ard,<br>
><br>
> I see you were involved in the OS side changes.<br>
><br>
> Can you explain what is required for the FW <-> OS interface with respect to Load File Protocol and this media device path node.<br>
><br>
> What happens if this media device path node is not present?  What breaks?<br>
><br>
> Trying to figure out if this is a required interop feature (MdePkg candidate) or an EDK II specific extension (MdeModulePkg candidate).<br>
><br>
<br>
Let me give some context first:<br>
<br>
Linux distro boot generally relies on an initial ramdisk (initrd)<br>
which is provided by the loader, and which contains additional kernel<br>
modules (for storage and netwerk, for instance), and the initial user<br>
space startup code, ie., the code which brings up the user space side<br>
of the entire OS.<br>
<br>
Before we introduced this media path, the only way for a EFI pre-OS<br>
loader (such as GRUB) to provide this initrd was to copy it into DRAM<br>
somewhere, and use a arch-specific method of passing the DRAM address<br>
and size to the OS (x86 uses struct bootparam, whereas ARM uses device<br>
tree). It also requires knowledge on the part of GRUB regarding which<br>
parts of DRAM are suitable for holding an initrd image. For measured<br>
boot scenarios, it may be an advantage not to have the initrd linger<br>
in DRAM for longer that necessary, and we actually intend to measure<br>
the initrd loaded via the new method right after it has been loaded<br>
this way.<br>
<br>
To avoid extending this to other architectures such as RISC-V, I<br>
decided to introduce a special vendor media path for Linux initrd<br>
images, which GRUB et al can implement, which provides the initrd<br>
image when the OS loader that consumes it asks for it.<br>
<br>
So for Linux on x86 or ARM, this is optional, given that support for<br>
the old method is not going away any time soon. For RISC-V, I<br>
suggested that only the new method be implemented, but I am not sure<br>
what the status is there. Note that many embedded style systems don't<br>
use GRUB, and may not use initrds to begin with. OTOH, U-Boot also<br>
implements support for the Linux initrd vendor media path, and work is<br>
ongoing to add measured boot support as well.<br>
<br>
In any case, I don't have a strong preference where this should live,<br>
as long as it is in a generic place where all architectures can use<br>
it.<br>
<br>
--<br>
Ard.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div></div>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/78087">View/Reply Online (#78087)</a> |    |  <a target="_blank" href="https://groups.io/mt/84231808/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>