[edk2-devel] [PATCH v1 4/6] UefiPayloadPkg: Reserve Payload config in runtime services data

Cheng-Chieh Huang via groups.io chengchieh=google.com at groups.io
Wed Aug 4 06:23:58 UTC 2021


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> 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 <devel at edk2.groups.io> On Behalf Of
> Cheng-Chieh Huang via groups.io
> Sent: Wednesday, July 21, 2021 6:23 AM
> To: devel at edk2.groups.io
> Cc: Cheng-Chieh Huang <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>
> ---
>  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 (#78648): https://edk2.groups.io/g/devel/message/78648
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/87b890b6/attachment.htm>


More information about the edk2-devel-archive mailing list