summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Ecc/CodeFragment.py
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2017-09-07 18:02:54 +0200
committerLaszlo Ersek <lersek@redhat.com>2017-09-08 20:24:06 +0200
commit7aee391fa3d01a9413e173686d04dac5842e7499 (patch)
tree7c187fc854bf18f5861d40a73db05f3a8a72dd2c /BaseTools/Source/Python/Ecc/CodeFragment.py
parent550acd08e555d9c9b7e3e0ccec28cd44d4fcb328 (diff)
downloadedk2-7aee391fa3d01a9413e173686d04dac5842e7499.tar.gz
edk2-7aee391fa3d01a9413e173686d04dac5842e7499.tar.bz2
edk2-7aee391fa3d01a9413e173686d04dac5842e7499.zip
OvmfPkg/IoMmuDxe: unmap all IOMMU mappings at ExitBootServices()
Register an ExitBootServices() callback that tears down all IOMMU mappings, without modifying the UEFI memory map. The trick is that in the ExitBootServices() callback, we don't immediately do the work; instead we signal another (private) event. Normally the dispatch order of ExitBootServices() callbacks is unspecified (within the same task priority level anyway). By queueing another function, we delay the unmapping until after all PciIo and Virtio drivers abort -- in their own ExitBootServices() callbacks -- the pending DMA operations of their respective controllers. Furthermore, the fact that IoMmuUnmapWorker() rewrites client-owned memory when it unmaps a Write or CommonBuffer bus master operation, is safe even in this context. The existence of any given "MapInfo" in "mMapInfos" implies that the client buffer pointed-to by "MapInfo->CryptedAddress" was live when ExitBootServices() was entered. And, after entering ExitBootServices(), nothing must have changed the UEFI memory map, hence the client buffer at "MapInfo->CryptedAddress" still exists. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Brijesh Singh <brijesh.singh@amd.com> Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Diffstat (limited to 'BaseTools/Source/Python/Ecc/CodeFragment.py')
0 files changed, 0 insertions, 0 deletions