tianocore / edk2

EDK II
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
Other
4.38k stars 2.4k forks source link

MdeModulePkg: Require IOMMU protocol before DMA access #5854

Open makubacki opened 6 days ago

makubacki commented 6 days ago

Description

Adds a PCD (gEfiMdeModulePkgTokenSpaceGuid.PcdRequireIommu) and support code to allow a platform to require that the IOMMU protocol be present before allowing PCI DMA operations to prevent DMA access prior to IOMMU initialization.

The default is FALSE for compatibility. It is recommended platforms set to TRUE and use the IOMMU protocol.

How This Was Tested

Integration Instructions

If using DMA, ensure the IOMMU protocol is installed before mapping buffers and set the PcdRequireIommu PCD introduced to TRUE.


Please let me know if there's feedback on the default PCD value (whether it should be TRUE which is potentially a breaking change or FALSE for compatibility).

mdkinney commented 5 days ago

Is there a way to make this condition impossible by construction and use depex to prevent PCI from being dispatches before IOMMU services are available? Can we have a Null IOMMU driver for platforms that do not have an IOMMU?