From bc8fde6f62fd038e709b4981babda0f7c7ba8418 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Sat, 12 Mar 2016 00:58:12 +0100 Subject: OvmfPkg: VIRTIO_DEVICE_PROTOCOL: widen the Features bitmap to 64 bits The virtio-1.0 spec widens the Features bitmap to 64 bits. Modify the declarations of the GetDeviceFeatures() and SetGuestFeatures() protocol member functions accordingly. Normally, a protocol cannot be changed in incompatible ways if the GUID stays the same; however, we've always been extremely clear that VIRTIO_DEVICE_PROTOCOL is internal to edk2. See for example the top of "OvmfPkg/Include/Protocol/VirtioDevice.h". In this patch, all producers and consumers of the GetDeviceFeatures() and SetGuestFeatures() protocol members are updated. The drivers that currently produce these members are "legacy" drivers (in virtio-1.0 terminology), and they cannot (and will not) handle feature bits above BIT31. Therefore their conversion is only for compatibility with the modified protocol interface. The consumers will be responsible for checking the VIRTIO_DEVICE_PROTOCOL.Revision field, and for not passing feature bits that these backends cannot handle. The VirtioMmioGetDeviceFeatures() implementation stores the result of an MmioRead32() call with normal assignment, so it needs no change beyond adapting its 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/VirtioNetDxe/DriverBinding.c | 2 +- OvmfPkg/VirtioNetDxe/SnpInitialize.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OvmfPkg/VirtioNetDxe') diff --git a/OvmfPkg/VirtioNetDxe/DriverBinding.c b/OvmfPkg/VirtioNetDxe/DriverBinding.c index 0ad39cf972..bcf9ebbdad 100644 --- a/OvmfPkg/VirtioNetDxe/DriverBinding.c +++ b/OvmfPkg/VirtioNetDxe/DriverBinding.c @@ -64,7 +64,7 @@ VirtioNetGetFeatures ( { EFI_STATUS Status; UINT8 NextDevStat; - UINT32 Features; + UINT64 Features; UINTN MacIdx; UINT16 LinkStatus; diff --git a/OvmfPkg/VirtioNetDxe/SnpInitialize.c b/OvmfPkg/VirtioNetDxe/SnpInitialize.c index 223030af9e..71b67fa52d 100644 --- a/OvmfPkg/VirtioNetDxe/SnpInitialize.c +++ b/OvmfPkg/VirtioNetDxe/SnpInitialize.c @@ -360,7 +360,7 @@ VirtioNetInitialize ( EFI_TPL OldTpl; EFI_STATUS Status; UINT8 NextDevStat; - UINT32 Features; + UINT64 Features; if (This == NULL) { return EFI_INVALID_PARAMETER; -- cgit v1.2.3