Jason Lowe-Power has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/25663 )

Change subject: cpu-kvm: Fix MMIO reads
......................................................................

cpu-kvm: Fix MMIO reads

Previously, MMIO reads did not return their data to the guest. This
patch sets the MMIO data of the kvm_run struct after the MMIO read.

Note: This might also need to be done on recvTmingResp, but I don't have
any examples to test that.

Issue: https://gem5.atlassian.net/browse/GEM5-69
Change-Id: Ib5ee05475ac4b1834775f3eb9a7f14459d457dc5
Signed-off-by: Jason Lowe-Power <ja...@lowepower.com>
---
M src/cpu/kvm/base.cc
1 file changed, 7 insertions(+), 4 deletions(-)



diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index cda98b4..7c3ba61 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -1134,10 +1134,13 @@
         // We currently assume that there is no need to migrate to a
         // different event queue when doing IPRs. Currently, IPRs are
         // only used for m5ops, so it should be a valid assumption.
-        const Cycles ipr_delay(write ?
-                             TheISA::handleIprWrite(tc, pkt) :
-                             TheISA::handleIprRead(tc, pkt));
-        threadContextDirty = true;
+        Cycles ipr_delay;
+        if (write) {
+            ipr_delay = TheISA::handleIprWrite(tc, pkt);
+        } else {
+            ipr_delay = TheISA::handleIprRead(tc, pkt);
+            memcpy(_kvmRun->mmio.data, pkt->getPtr<uint8_t>(), size);
+        }
         delete pkt;
         return clockPeriod() * ipr_delay;
     } else {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/25663
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v19.0.0.0
Gerrit-Change-Id: Ib5ee05475ac4b1834775f3eb9a7f14459d457dc5
Gerrit-Change-Number: 25663
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to