Hi, Set "Address = BASE_4GB - 1" first is to ensure the maximum address value is 4GB, since APs will be switched to 32 bit before OS, I mean in the original implementation. By the way, in patch 5, only SEV-ES processor keep this limitation, since for the generic processors they keep in 64 bit before handing off the process to OS, and for those 32-bit processors, they don't need this limitation.
Regards, Yuanhao -----Original Message----- From: Gerd Hoffmann <kra...@redhat.com> Sent: Tuesday, February 21, 2023 5:26 PM To: devel@edk2.groups.io; Xie, Yuanhao <yuanhao....@intel.com> Cc: Dong, Guo <guo.d...@intel.com>; Ni, Ray <ray...@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu, James <james...@intel.com>; Guo, Gua <gua....@intel.com> Subject: Re: [edk2-devel] [Patch V2 2/5] UefiCpuPkg: Contiguous memory allocation and code clean-up. Hi, > + Address = BASE_4GB - 1; Why do you set Address here ... > + Status = gBS->AllocatePages ( > + AllocateMaxAddress, > + EfiReservedMemoryType, > + StackPages+FuncPages, > + &Address > + ); ... when it is overridden here anyway? Otherwise the patch looks good to me. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100453): https://edk2.groups.io/g/devel/message/100453 Mute This Topic: https://groups.io/mt/97081030/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-