From 07af4eee931210bad04b98d37a35bd0f61ba6bd3 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Sat, 12 Mar 2016 03:39:00 +0100 Subject: 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 Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Tested-by: Ard Biesheuvel Reviewed-by: Jordan Justen --- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h | 4 ++-- OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OvmfPkg/VirtioPciDeviceDxe') diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h index 95f82611e2..8f17a16c88 100644 --- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h @@ -124,8 +124,8 @@ VirtioPciSetGuestFeatures ( EFI_STATUS EFIAPI VirtioPciSetQueueAddress ( - VIRTIO_DEVICE_PROTOCOL *This, - UINT32 Address + IN VIRTIO_DEVICE_PROTOCOL *This, + IN VRING *Ring ); EFI_STATUS diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c index 4ba37a2d1c..243aa14c24 100644 --- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c @@ -181,8 +181,8 @@ VirtioPciSetGuestFeatures ( EFI_STATUS EFIAPI VirtioPciSetQueueAddress ( - VIRTIO_DEVICE_PROTOCOL *This, - UINT32 Address + IN VIRTIO_DEVICE_PROTOCOL *This, + IN VRING *Ring ) { VIRTIO_PCI_DEVICE *Dev; @@ -190,7 +190,7 @@ VirtioPciSetQueueAddress ( Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This); return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_ADDRESS, sizeof (UINT32), - Address); + (UINT32)((UINTN)Ring->Base >> EFI_PAGE_SHIFT)); } EFI_STATUS -- cgit v1.2.3