summary refs log tree commit diff
path: root/devices/src/virtio/virtio_pci_common_config.rs
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2018-10-24 13:07:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-11-26 20:31:22 -0800
commitf4ee2ad205b5e014575252c9eccd0ae0bb306b8a (patch)
tree0838f5f3221b01e49a257f2dc9221b13ec84e068 /devices/src/virtio/virtio_pci_common_config.rs
parent45cfe2164b3feed15ae5a58bcd91176fbb788e9d (diff)
downloadcrosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.tar
crosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.tar.gz
crosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.tar.bz2
crosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.tar.lz
crosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.tar.xz
crosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.tar.zst
crosvm-f4ee2ad205b5e014575252c9eccd0ae0bb306b8a.zip
devices: make all virtio devices report version 1
Our virtio devices are all "modern" (no legacy/transitional support).
Add VIRTIO_F_VERSION_1 to the features() handler for all virtio devices
that didn't already have it.

This lets us remove the hack that forced VIRTIO_F_VERSION_1 on for all
devices.

BUG=None
TEST=build_test; boot crosvm on kevin

Change-Id: I008926a9075679aae46069aa37a14504f10e8584
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1313013
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'devices/src/virtio/virtio_pci_common_config.rs')
-rw-r--r--devices/src/virtio/virtio_pci_common_config.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/devices/src/virtio/virtio_pci_common_config.rs b/devices/src/virtio/virtio_pci_common_config.rs
index efbfbe0..4f30b3d 100644
--- a/devices/src/virtio/virtio_pci_common_config.rs
+++ b/devices/src/virtio/virtio_pci_common_config.rs
@@ -135,14 +135,10 @@ impl VirtioPciCommonConfig {
         match offset {
             0x00 => self.device_feature_select,
             0x04 => {
-                // TODO(dverkamp): This hack (copied from MmioDevice) unconditionally
-                // reports support for VIRTIO_F_VERSION_1; once all devices have been
-                // fixed to report VIRTIO_F_VERSION_1, remove this workaround.
-                let features = device.features() | 1 << VIRTIO_F_VERSION_1;
                 // Only 64 bits of features (2 pages) are defined for now, so limit
                 // device_feature_select to avoid shifting by 64 or more bits.
                 if self.device_feature_select < 2 {
-                    (features >> (self.device_feature_select * 32)) as u32
+                    (device.features() >> (self.device_feature_select * 32)) as u32
                 } else {
                     0
                 }