On 08/02/17 01:51, Brijesh Singh wrote: > On 8/1/17 4:59 PM, Laszlo Ersek wrote:
>> Please implement the free-list idea that I outlined earlier. Unmap() >> must not call FreePool() on the MAP_INFO structures. > > Sorry it was my bad. I missed implementing that feedback. I will fix it > in next rev. As you have outlined in previous feedback that Unmap() can > be called from ExitBootService() hence i will refrain from using > FreePool() or MemEncryptSev*() functions in this sequence (except when > freeing the actual bounce buffer). No, you have to distinguish the C-bit's management and memory releasing. Unmap must restore the C bit on the bounce buffer, for all of BusMasterRead, BusMasterWrite, and BusMasterCommonBuffer. This is required regardless of whether the bounce buffer was allocated implicitly (for BusMasterRead and BusMasterWrite) or explicitly (for BusMasterCommonBuffer, in AllocateBuffer()). Unmap must zero and release the implicitly allocated bounce buffer for BusMasterRead, BusMasterWrite. Unmap must neither zero nor release the explicitly allocated buffer for BusMasterCommonBuffer. For that operation, FreeBuffer() must do both steps. Unmap must put MAP_INFO back on the internal free list for BusMasterCommonBuffer. For BusMasterRead and BusMasterWrite, Unmap can release MAP_INFO with FreePool(). Thanks Laszlo _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

