kvm: Correctly handle the return value from handleIpr(Read|Write)
authorAndreas Sandberg <andreas@sandberg.pp.se>
Thu, 19 Sep 2013 15:55:04 +0000 (17:55 +0200)
committerAndreas Sandberg <andreas@sandberg.pp.se>
Thu, 19 Sep 2013 15:55:04 +0000 (17:55 +0200)
The KVM base class incorrectly assumed that handleIprRead and
handleIprWrite both return ticks. This is not the case, instead they
return cycles. This changeset converts the returned cycles to ticks
when handling IPR accesses.

src/cpu/kvm/base.cc

index 1631fb54c67fff3196ccd58dabf7837e77eadf4f..594c5b7aea21c0bd2ad238a2421137151aab6aad 100644 (file)
@@ -969,10 +969,10 @@ BaseKvmCPU::doMMIOAccess(Addr paddr, void *data, int size, bool write)
     pkt.dataStatic(data);
 
     if (mmio_req.isMmappedIpr()) {
-        if (write)
-            return TheISA::handleIprWrite(tc, &pkt);
-        else
-            return TheISA::handleIprRead(tc, &pkt);
+        const Cycles ipr_delay(write ?
+                             TheISA::handleIprWrite(tc, &pkt) :
+                             TheISA::handleIprRead(tc, &pkt));
+        return clockEdge(ipr_delay);
     } else {
         return dataPort.sendAtomic(&pkt);
     }