]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/VirtioBlkDxe: negotiate VIRTIO_F_IOMMU_PLATFORM
authorBrijesh Singh <brijesh.singh@amd.com>
Sun, 27 Aug 2017 22:53:32 +0000 (18:53 -0400)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 28 Aug 2017 09:00:14 +0000 (11:00 +0200)
VirtioBlkDxe driver has been updated to use IOMMU-like member functions
from VIRTIO_DEVICE_PROTOCOL to translate the system physical address to
device address. We do not need to do anything special when
VIRTIO_F_IOMMU_PLATFORM bit is present hence treat it in parallel with
VIRTIO_F_VERSION_1.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/VirtioBlkDxe/VirtioBlk.c

index c9c42aa41243b234a66726f52391ab0993128e59..6abd937f86c6c2c677d04b2652b465d0568937e1 100644 (file)
@@ -808,7 +808,8 @@ VirtioBlkInit (
   }\r
 \r
   Features &= VIRTIO_BLK_F_BLK_SIZE | VIRTIO_BLK_F_TOPOLOGY | VIRTIO_BLK_F_RO |\r
-              VIRTIO_BLK_F_FLUSH | VIRTIO_F_VERSION_1;\r
+              VIRTIO_BLK_F_FLUSH | VIRTIO_F_VERSION_1 |\r
+              VIRTIO_F_IOMMU_PLATFORM;\r
 \r
   //\r
   // In virtio-1.0, feature negotiation is expected to complete before queue\r
@@ -886,7 +887,7 @@ VirtioBlkInit (
   // step 5 -- Report understood features.\r
   //\r
   if (Dev->VirtIo->Revision < VIRTIO_SPEC_REVISION (1, 0, 0)) {\r
-    Features &= ~(UINT64)VIRTIO_F_VERSION_1;\r
+    Features &= ~(UINT64)(VIRTIO_F_VERSION_1 | VIRTIO_F_IOMMU_PLATFORM);\r
     Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);\r
     if (EFI_ERROR (Status)) {\r
       goto UnmapQueue;\r