On December 14, 2021 9:59 PM, Ard Biesheuvel wrote: > On Tue, 14 Dec 2021 at 14:42, Min Xu <min.m...@intel.com> wrote: > > > > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 > > > > This function is a null stub to make the build success. > > > > --- > > .../MemoryAllocationLib.c | 28 +++++++++++++++++++ > > 1 file changed, 28 insertions(+) > > > > Why is it justified to implement a broken version of this routine? > This is not a NULL library class that only exists for build test purposes, it > is > actually used in production builds. > > If the TDVF code needs the symbol but does not actually call it, perhaps > there is > another place where this should get fixed? > PeiServicesLib (MdePkg/Library/PeiServicesLib/PeiServicesLib.inf) is imported in In OvmfPkg/Sec/SecMain.inf. In the implementation of this lib, AllocateCopyPool is used. AllocateCopyPool is implemented in MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf. With the introduction of TDVF Config-B, MemoryAllocationLib is changed to EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf. In this MemoryAllocationLib, AllocateCopyPool is not implemented. So I have to add a null stub of AllocateCopyPool in EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
I carefully re-check the OvmfPkg/Sec and find PeiServicesLib is not needed. So PeiServiceLib is removed from SecMain.inf. This time AllocateCopyPool is not needed either. So this commit will be dropped in the next version. Thanks much for your reminder. Min -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84948): https://edk2.groups.io/g/devel/message/84948 Mute This Topic: https://groups.io/mt/87720795/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-