Hi, > > I think we need clearly document what service can be used in > EFI_ACCEPT_MEMORY. > For example, can we use memory allocation service, GCD service, or MP > service?
GCD service is provided by EFI_DXE_SERVICES, it can be used by EFI_ACCEPT_MEMORY (So updating the GCD memory map in the protocol is an option). Memory allocation service can be used too. We are not using MP service for now. If we need to use MP service, I think we can register a protocol notify to install EFI_ACCEPT_MEMORY when EFI_MP_SERVICE_PROTOCOL is ready. > > In https://github.com/mxu9/edk2/pull/9/commits, I do not find the > producer of EFI_ACCEPT_MEMORY, would you please give me some hint? > EFI_ACCEPT_MEMORY is installed by TdxDxe in our POC: https://github.com/mxu9/edk2/pull/9/commits/45974892883847f9c0397ca8efcc86a0318b2c6e > Couple of dependency issue: > If EFI_ACCEPT_MEMORY cannot use MP service, then there might be > performance concern. > If it uses MP service, then we need ensure MP service is installed earlier and > before memory accept request. > I think we need a way to ensure there is enough memory *before* the > protocol is installed, right? > Since the memory needed by protocol is the *certain* part and it will not change, I think it can be ensured. > > Also, would you please clarify how to fix below comment? > // > // Fix me! CoreAddMemorySpace() should not be called in the allocation > process > // because it will allocate memory for GCD map entry. > // > A possible solution is to split the update of Memory Map and GCD Memory Space Map, newly accepted memory range can be added to Memory Map (through CoreAddRange(), an internal function in page management) for memory allocation firstly, then CoreAddMemorySpace() can be called safely. This method will cause an duplicate entry in memory map. We have to do some fix in CoreAddRange() to avoid adding same range repeatedly. Or we can use similarly way as mMapStack[] in page management for GCD map entry allocation too. I'm not sure these are reasonable and logical solutions, so I'm trying to find another way. Thank you, Jiaqi -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#80213): https://edk2.groups.io/g/devel/message/80213 Mute This Topic: https://groups.io/mt/85267822/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-