summaryrefslogtreecommitdiff
path: root/src/dev/virtio
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-12-08 04:49:51 -0500
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-12-08 04:49:51 -0500
commit1ccc4e0e21e5a47640b2a8bd6864988c3dfb5926 (patch)
treecc8c06743203637a498a6880ed02ad17de3da7b9 /src/dev/virtio
parent4a8a0a07982b7896127d0cb723fde08b3825bb48 (diff)
downloadgem5-1ccc4e0e21e5a47640b2a8bd6864988c3dfb5926.tar.xz
dev: Correctly transform packets into responses
The VirtIO devices didn't correctly set the response flags in memory packets. This changeset adds the required Packet::makeResponse() calls.
Diffstat (limited to 'src/dev/virtio')
-rw-r--r--src/dev/virtio/base.cc2
-rw-r--r--src/dev/virtio/pci.cc4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/dev/virtio/base.cc b/src/dev/virtio/base.cc
index 06c6e3452..a65fe7fa4 100644
--- a/src/dev/virtio/base.cc
+++ b/src/dev/virtio/base.cc
@@ -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);
}
diff --git a/src/dev/virtio/pci.cc b/src/dev/virtio/pci.cc
index c77b61934..a051a8f51 100644
--- a/src/dev/virtio/pci.cc
+++ b/src/dev/virtio/pci.cc
@@ -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.");