summaryrefslogtreecommitdiff
path: root/src/cpu/kvm/base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/kvm/base.cc')
-rw-r--r--src/cpu/kvm/base.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index 0b3888976..384abb0eb 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -630,9 +630,7 @@ BaseKvmCPU::tick()
case RunningServiceCompletion:
case Running: {
- const uint64_t nextInstEvent(
- !comInstEventQueue[0]->empty() ?
- comInstEventQueue[0]->nextTick() : UINT64_MAX);
+ const uint64_t nextInstEvent(nextInstEventCount(0));
// Enter into KVM and complete pending IO instructions if we
// have an instruction event pending.
const Tick ticksToExecute(
@@ -688,7 +686,7 @@ BaseKvmCPU::tick()
// 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);
+ serviceInstCountEvents(0, ctrInsts);
if (tryDrain())
_status = Idle;
@@ -1348,11 +1346,10 @@ BaseKvmCPU::ioctlRun()
void
BaseKvmCPU::setupInstStop()
{
- if (comInstEventQueue[0]->empty()) {
+ Tick next = nextInstEventCount(0);
+ if (next == MaxTick) {
setupInstCounter(0);
} else {
- const uint64_t next(comInstEventQueue[0]->nextTick());
-
assert(next > ctrInsts);
setupInstCounter(next - ctrInsts);
}