dev: Correctly transform packets into responses
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>
Mon, 8 Dec 2014 09:49:51 +0000 (04:49 -0500)
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>
Mon, 8 Dec 2014 09:49:51 +0000 (04:49 -0500)
The VirtIO devices didn't correctly set the response flags in memory
packets. This changeset adds the required Packet::makeResponse()
calls.

src/dev/virtio/base.cc
src/dev/virtio/pci.cc

index 06c6e34521dcb571ec7f148aab663caf2f3f0989..a65fe7fa488f16d0194137ff0a12db012014f4fb 100644 (file)
@@ -426,6 +426,7 @@ VirtIODeviceBase::readConfigBlob(PacketPtr pkt, Addr cfgOffset, const uint8_t *c
     if (cfgOffset + size > configSize)
         panic("Config read out of bounds.\n");
 
+    pkt->makeResponse();
     pkt->setData(const_cast<uint8_t *>(cfg) + cfgOffset);
 }
 
@@ -437,6 +438,7 @@ VirtIODeviceBase::writeConfigBlob(PacketPtr pkt, Addr cfgOffset, uint8_t *cfg)
     if (cfgOffset + size > configSize)
         panic("Config write out of bounds.\n");
 
+    pkt->makeResponse();
     pkt->writeData((uint8_t *)cfg + cfgOffset);
 }
 
index c77b61934d1e6ea97fc301c731dce386eec3661a..a051a8f51adbc04c5221a5adf615c3a953cb10bf 100644 (file)
@@ -75,6 +75,8 @@ PciVirtIO::read(PacketPtr pkt)
         return 0;
     }
 
+    pkt->makeResponse();
+
     switch(offset) {
       case OFF_DEVICE_FEATURES:
         DPRINTF(VIOPci, "   DEVICE_FEATURES request\n");
@@ -151,6 +153,8 @@ PciVirtIO::write(PacketPtr pkt)
         return 0;
     }
 
+    pkt->makeResponse();
+
     switch(offset) {
       case OFF_DEVICE_FEATURES:
         warn("Guest tried to write device features.");