kvm: Service events in the instruction event queues
authorAndreas Sandberg <andreas@sandberg.pp.se>
Thu, 3 Oct 2013 09:00:18 +0000 (11:00 +0200)
committerAndreas Sandberg <andreas@sandberg.pp.se>
Thu, 3 Oct 2013 09:00:18 +0000 (11:00 +0200)
This changset adds calls to the service the instruction event queues
that accidentally went missing from commit [0063c7dd18ec]. The
original commit only included the code needed to schedule instruction
stops from KVM and missed the functionality to actually service the
events.

src/cpu/kvm/base.cc

index 5e3ec279ac7e91bbbaad006c02ca77cf06ebc8cf..d43288f4f7b0d12118e0164ae4fcb4944094c094 100644 (file)
@@ -540,6 +540,12 @@ BaseKvmCPU::tick()
               _status = Running;
           }
 
+          // Service any pending instruction events. The vCPU should
+          // have exited in time for the event using the instruction
+          // counter configured by setupInstStop().
+          comInstEventQueue[0]->serviceEvents(ctrInsts);
+          system->instEventQueue.serviceEvents(system->totalNumInsts);
+
           if (tryDrain())
               _status = Idle;
       } break;
@@ -1179,7 +1185,6 @@ BaseKvmCPU::ioctlRun()
 void
 BaseKvmCPU::setupInstStop()
 {
-
     if (comInstEventQueue[0]->empty()) {
         setupInstCounter(0);
     } else {