summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiran Alon <liran.alon@oracle.com>2020-03-28 23:01:00 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-30 16:45:07 +0000
commitf34c7645bd87c61f72c2bc4a8f88afabc69de512 (patch)
tree7c9fbad70e11a1eb69ee1ebae258ee6c9d3c1697
parent7d8a04e9d2fd8a5298636d5a0c702a978b5f22f1 (diff)
downloadedk2-f34c7645bd87c61f72c2bc4a8f88afabc69de512.tar.gz
edk2-f34c7645bd87c61f72c2bc4a8f88afabc69de512.tar.bz2
edk2-f34c7645bd87c61f72c2bc4a8f88afabc69de512.zip
OvmfPkg/PvScsiDxe: Enable device 64-bit DMA addresses
Enable PCI dual-address cycle attribute to signal device supports 64-bit DMA addresses. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-18-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
-rw-r--r--OvmfPkg/PvScsiDxe/PvScsi.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c
index d7f0d3c879..0a66c98421 100644
--- a/OvmfPkg/PvScsiDxe/PvScsi.c
+++ b/OvmfPkg/PvScsiDxe/PvScsi.c
@@ -874,6 +874,29 @@ PvScsiSetPciAttributes (
return Status;
}
+ //
+ // Signal device supports 64-bit DMA addresses
+ //
+ Status = Dev->PciIo->Attributes (
+ Dev->PciIo,
+ EfiPciIoAttributeOperationEnable,
+ EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ //
+ // Warn user that device will only be using 32-bit DMA addresses.
+ //
+ // Note that this does not prevent the device/driver from working
+ // and therefore we only warn and continue as usual.
+ //
+ DEBUG ((
+ DEBUG_WARN,
+ "%a: failed to enable 64-bit DMA addresses\n",
+ __FUNCTION__
+ ));
+ }
+
return EFI_SUCCESS;
}