On Thu, Sep 08, 2022 at 12:48:05AM +0000, Xu, Min M wrote: > On September 7, 2022 1:42 PM, Gerd Hoffmann wrote: > > Hi, > > > > > + // > > > + // This memory region is split into 2 parts. The left part is > > > accepted. > > > + // > > > + PhysicalEnd = MaxAcceptedMemoryAddress; > > > + ResourceLength = PhysicalEnd - PhysicalStart; > > > > Same comment here. Can't happen when all memory below 4G is accepted, > > and I think MaxAcceptedMemoryAddress is not needed either.
> It may happen. For example, a TD VM is created with 2G memory, then > the MaxAcceptedMemoryAddress is 0x80000000. If it is created with 1G > memory, MaxAcceptedMemoryAddress is 0x40000000. This information can > be retrieved by walking thru the TD-Hob and read the largest address > of the unaccept-mem-region under 4G. But I think it's easier to > record the value in MaxAcceptedMemoryAddress. And it can be used when > not all memory below 4G is accepted. Memory regions wouldn't cross the 4G border, they are either completely below 4G or completely above 4G. So when we accept all memory below 4G we will never have to split a memory region and you can easily figure whenever an region is accepted or not by checking whenever it is above or below 4G. I still don't see what MaxAcceptedMemoryAddress would be needed for given that when we never have to split memory regions. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#93520): https://edk2.groups.io/g/devel/message/93520 Mute This Topic: https://groups.io/mt/93474520/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-