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/VirtioBlkDxe/VirtioBlk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OvmfPkg/VirtioBlkDxe') diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c index 61b9cab..bff15fe 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c @@ -745,7 +745,7 @@ VirtioBlkInit ( // // step 4c -- Report GPFN (guest-physical frame number) of queue. // - Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo, &Dev->Ring); + Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo, &Dev->Ring, 0); if (EFI_ERROR (Status)) { goto ReleaseQueue; } -- cgit v1.1