From 53a4c6047f3ce2ece7bb8db5b9815a1c9227dddb Mon Sep 17 00:00:00 2001 From: Brijesh Singh Date: Wed, 23 Aug 2017 06:57:17 -0400 Subject: OvmfPkg/Virtio: take RingBaseShift in SetQueueAddress() For the case when an IOMMU is used for translating system physical addresses to DMA bus master addresses, the transport-independent virtio device drivers will be required to map their VRING areas to bus addresses with VIRTIO_DEVICE_PROTOCOL.MapSharedBuffer() calls. - MMIO and legacy virtio transport do not support IOMMU to translate the addresses hence RingBaseShift will always be set to zero. - modern virtio transport supports IOMMU to translate the address, in next patch we will update the Virtio10Dxe to use RingBaseShift offset. Suggested-by: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Tom Lendacky Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh [lersek@redhat.com: remove commit msg paragraph with VirtioLib reference] [lersek@redhat.com: fix typo in VIRTIO_SET_QUEUE_ADDRESS comment block] Reviewed-by: Laszlo Ersek Regression-tested-by: Laszlo Ersek --- OvmfPkg/VirtioGpuDxe/Commands.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OvmfPkg/VirtioGpuDxe') diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c index c2e4d72feb..5cb0031612 100644 --- a/OvmfPkg/VirtioGpuDxe/Commands.c +++ b/OvmfPkg/VirtioGpuDxe/Commands.c @@ -132,7 +132,11 @@ VirtioGpuInit ( if (EFI_ERROR (Status)) { goto Failed; } - Status = VgpuDev->VirtIo->SetQueueAddress (VgpuDev->VirtIo, &VgpuDev->Ring); + Status = VgpuDev->VirtIo->SetQueueAddress ( + VgpuDev->VirtIo, + &VgpuDev->Ring, + 0 + ); if (EFI_ERROR (Status)) { goto ReleaseQueue; } -- cgit v1.2.3