[edk2-devel] [PATCH v1 4/6] UefiPayloadPkg: Reserve Payload config in runtime services data
Guo Dong
guo.dong at intel.com
Wed Aug 4 13:37:18 UTC 2021
Hi Cheng-Chieh,
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.
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.
For this patch, you could add LINUXBOOT_PAYLOAD flag with commit message update, I will revert this patch once above change is completed.
Thanks,
Guo
From: Cheng-Chieh Huang <chengchieh at google.com>
Sent: Tuesday, August 3, 2021 11:24 PM
To: Dong, Guo <guo.dong at intel.com>
Cc: devel at edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v1 4/6] UefiPayloadPkg: Reserve Payload config in runtime services data
Hi Guo,
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?
--
Cheng-Chieh
On Wed, Aug 4, 2021 at 10:44 AM Dong, Guo <guo.dong at intel.com<mailto:guo.dong at intel.com>> wrote:
why build runtime memory allocation hob here?
The PayloadEntry should already got the information and build a new HOB list to DXE core, will anyone access these region late?
If yes, maybe you need add LINUXBOOT_PAYLOAD flag for this code, and update commit message on this.
Thanks,
Guo
-----Original Message-----
From: devel at edk2.groups.io<mailto:devel at edk2.groups.io> <devel at edk2.groups.io<mailto:devel at edk2.groups.io>> On Behalf Of Cheng-Chieh Huang via groups.io<http://groups.io>
Sent: Wednesday, July 21, 2021 6:23 AM
To: devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Cheng-Chieh Huang <chengchieh at google.com<mailto:chengchieh at google.com>>
Subject: [edk2-devel] [PATCH v1 4/6] UefiPayloadPkg: Reserve Payload config in runtime services data
Signed-off-by: Cheng-Chieh Huang <chengchieh at google.com<mailto:chengchieh at google.com>>
---
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index ae16f25c7c0e..70afbf83ed4a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -517,6 +517,8 @@ BuildGenericHob (
// The UEFI payload FV
BuildMemoryAllocationHob (PcdGet32 (PcdPayloadFdMemBase), PcdGet32 (PcdPayloadFdMemSize), EfiBootServicesData);
+ // The UEFI payload config FV
+ BuildMemoryAllocationHob (PcdGet32 (PcdPayloadFdMemBase) - SIZE_64KB, SIZE_64KB, EfiRuntimeServicesData);
//
// Build CPU memory space and IO space hob
--
2.32.0.402.g57bb445576-goog
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78647): https://edk2.groups.io/g/devel/message/78647
Mute This Topic: https://groups.io/mt/84357536/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20210804/156821ac/attachment.htm>
More information about the edk2-devel-archive
mailing list