I have found that OVMF fails to detect the disk when iommu_platform is set from
qemu cli. The failure occurs during the feature bit negotiation.
Recently, EDKII introduced IOMMU protocol d1fddc4533bf. SEV patch series
introduced
a IoMmu protocol driver f9d129e68a45 to set a DMA access attribute and methods
to
allocate, free, map and unmap the DMA memory for the master bus devices
In this patch series, I have tried to enable the IOMMU_PLATFORM feature for
VirtioBlkDevice. I am sending this as RFC to seek feedback before I extend the
support
for other Virtio devices. The patch has been tested in SEV guest - mainly
because
IoMmuDxe driver installs the IOMMU protocol for SEV guest only. If needed, I can
extend the IoMmuDxe driver to install IOMMU protocol for non SEV guests.
qemu cli used for testing:
# $QEMU \
...
-drive file=${HDA_FILE},if=none,id=disk0,format=qcow2 \
-device
virtio-blk-pci,drive=disk0,disable-legacy=on,iommu_platform=true,disable-modern=off,scsi=off
...
Cc: Jordan Justen <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <[email protected]>
Brijesh Singh (3):
OvmfPkg/Include/Virtio10: Define VIRTIO_F_IOMMU_PLATFORM feature bit
OvmfPkg/VirtioLib: Add IOMMU_PLATFORM support
OvmfPkg/VirtioBlkDxe: Add VIRITO_F_IOMMU_PLATFORM support
OvmfPkg/Library/VirtioLib/VirtioLib.inf | 1 +
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf | 5 +
OvmfPkg/VirtioGpuDxe/VirtioGpu.inf | 1 +
OvmfPkg/VirtioNetDxe/VirtioNet.inf | 1 +
OvmfPkg/VirtioRngDxe/VirtioRng.inf | 1 +
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf | 1 +
OvmfPkg/Include/IndustryStandard/Virtio095.h | 1 +
OvmfPkg/Include/IndustryStandard/Virtio10.h | 5 +
OvmfPkg/Include/Library/VirtioLib.h | 20 ++++
OvmfPkg/Library/VirtioLib/VirtioLib.c | 96 ++++++++++++++-
OvmfPkg/VirtioBlkDxe/VirtioBlk.c | 125 ++++++++++++++++++--
11 files changed, 244 insertions(+), 13 deletions(-)
--
Brijesh Singh
2.7.4
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel