diff mbox

[edk2,wave,3,04/15] OvmfPkg: VirtioBlkDxe: don't clear non-negotiable feature bits

Message ID 1457960012-29481-5-git-send-email-lersek@redhat.com
State Superseded
Headers show

Commit Message

Laszlo Ersek March 14, 2016, 12:53 p.m. UTC
VirtioBlkDxe only recognizes virtio-block feature bits that the device
offers non-negotiably. Nonetheless, in preparation for the following
patches, don't try to clear them even for simplicity.

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>

---
 OvmfPkg/VirtioBlkDxe/VirtioBlk.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

-- 
1.8.3.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
index daccc7a5d06b..8257effac22d 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
@@ -733,20 +733,19 @@  VirtioBlkInit (
   Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo, &Dev->Ring);
   if (EFI_ERROR (Status)) {
     goto ReleaseQueue;
   }
 
 
   //
-  // step 5 -- Report understood features. There are no virtio-blk specific
-  // features to negotiate in virtio-0.9.5, plus we do not want any of the
-  // device-independent (known or unknown) VIRTIO_F_* capabilities (see
-  // Appendix B).
+  // step 5 -- Report understood features.
   //
-  Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, 0);
+  Features &= VIRTIO_BLK_F_BLK_SIZE | VIRTIO_BLK_F_TOPOLOGY | VIRTIO_BLK_F_RO |
+              VIRTIO_BLK_F_FLUSH;
+  Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);
   if (EFI_ERROR (Status)) {
     goto ReleaseQueue;
   }
 
   //
   // step 6 -- initialization complete
   //