<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Cheng-Chieh,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I see. In order to use same PlatformHookLib to make DebugLib works in both PayloadEntry and DXE phase, the PlatformHookLib gets serial port info from bootloader.<o:p></o:p></p>
<p class="MsoNormal">In the DXE phase, UniversalPayloadPlatformHookLib will use HOB instead of getting info from bootloader. In the PayloadEntry module, we should build same serial port HOB so that DXE module could use UniversalPayloadPlatformHookLib Instead
 of PlatformHookLib.<o:p></o:p></p>
<p class="MsoNormal">For this patch, you could add LINUXBOOT_PAYLOAD flag with commit message update, I will revert this patch once above change is completed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Guo<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Cheng-Chieh Huang <chengchieh@google.com> <br>
<b>Sent:</b> Tuesday, August 3, 2021 11:24 PM<br>
<b>To:</b> Dong, Guo <guo.dong@intel.com><br>
<b>Cc:</b> devel@edk2.groups.io<br>
<b>Subject:</b> Re: [edk2-devel] [PATCH v1 4/6] UefiPayloadPkg: Reserve Payload config in runtime services data<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Guo,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks for the review. This is a quick fix for today's PlatformHookLib design. PlatformHookLib (probably via PlatformBootManagerLib) will be linked by BDS and potentially called again in Windows bootloader. If we did not reserve this range
 of memory, system will crash the system when it was called. This can be reproduced if we boot Windows 2018. I also did not think reserving this memory til runtime is a good idea, but I am not sure why we want to link PlatformHookLib to PlatformBootManagerLib.
 I tried to remove PlatformHookLib in PlatformBootManagerLib and it seems to work as well. maybe we should take this approach. what do you think?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Cheng-Chieh<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Aug 4, 2021 at 10:44 AM Dong, Guo <<a href="mailto:guo.dong@intel.com" target="_blank">guo.dong@intel.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
why build runtime memory allocation hob here? <br>
The PayloadEntry should already got the information and build a new HOB list to DXE core, will anyone access these region late?<br>
If yes, maybe you need add LINUXBOOT_PAYLOAD flag for this code, and update commit message on this.<br>
<br>
Thanks,<br>
Guo<br>
<br>
-----Original Message-----<br>
From: <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>> On Behalf Of Cheng-Chieh Huang via
<a href="http://groups.io" target="_blank">groups.io</a><br>
Sent: Wednesday, July 21, 2021 6:23 AM<br>
To: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a><br>
Cc: Cheng-Chieh Huang <<a href="mailto:chengchieh@google.com" target="_blank">chengchieh@google.com</a>><br>
Subject: [edk2-devel] [PATCH v1 4/6] UefiPayloadPkg: Reserve Payload config in runtime services data<br>
<br>
Signed-off-by: Cheng-Chieh Huang <<a href="mailto:chengchieh@google.com" target="_blank">chengchieh@google.com</a>><br>
---<br>
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 2 ++<br>
 1 file changed, 2 insertions(+)<br>
<br>
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c<br>
index ae16f25c7c0e..70afbf83ed4a 100644<br>
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c<br>
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c<br>
@@ -517,6 +517,8 @@ BuildGenericHob (<br>
<br>
   // The UEFI payload FV<br>
   BuildMemoryAllocationHob (PcdGet32 (PcdPayloadFdMemBase), PcdGet32 (PcdPayloadFdMemSize), EfiBootServicesData);<br>
+  // The UEFI payload config FV<br>
+  BuildMemoryAllocationHob (PcdGet32 (PcdPayloadFdMemBase) - SIZE_64KB, SIZE_64KB, EfiRuntimeServicesData);<br>
<br>
   //<br>
   // Build CPU memory space and IO space hob<br>
-- <br>
2.32.0.402.g57bb445576-goog<br>
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>


 <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/78647">View/Reply Online (#78647)</a> |    |  <a target="_blank" href="https://groups.io/mt/84357536/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>