]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
MdeModulePkg/PciHostBridgeDxe: restrict 64-bit DMA to devices that support it
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 5 Sep 2016 08:55:16 +0000 (09:55 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 6 Sep 2016 14:46:38 +0000 (15:46 +0100)
commite58a71d9c50ba641b5ab19f5ce2cbf772187de4d
treed6926b29ec202ba6bd623d781b83feceff30617e
parent5c1b371a8839f970a45df3342529d034524f2507
MdeModulePkg/PciHostBridgeDxe: restrict 64-bit DMA to devices that support it

Currently, the EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute is completely
ignored by the PCI host bridge driver, which means that, on an implementation
that supports DMA above 4 GB, allocations above 4 GB may be provided to
devices that have not expressed support for it.

So in addition to checking 'RootBridge->DmaAbove4G' to establish whether the
root bridge itself supports DMA above 4 GB, we must also take into account
the operation type (EfiPciOperationBusMaster{Read|Write|CommonBuffer}64),
and the EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute, when mapping and
allocating DMA memory, respectively.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c