OvmfPkg: VIRTIO_DEVICE_PROTOCOL: pass VRING object to SetQueueAddress()

In virtio-1.0, it is not enough to pass the base address of the virtio
queue to the hypervisor (as a frame number); instead it will want the
addresses of the descriptor table, the available ring, and the used ring
separately. Pass the VRING object to the SetQueueAddress() member
function; this will enable a virtio-1.0 implementation. Convert the
current producers and consumers to this prototype.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Laszlo Ersek
2016-03-12 03:39:00 +01:00
parent 235be6a0f1
commit 07af4eee93
9 changed files with 21 additions and 24 deletions

View File

@@ -95,8 +95,7 @@ VirtioNetInitRing (
//
// step 4c -- report GPFN (guest-physical frame number) of queue
//
Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
(UINT32) ((UINTN) Ring->Base >> EFI_PAGE_SHIFT));
Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo, Ring);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}