cpu: Make accesses to comInstEventQueue indirect through methods.

This lets us move the event queue itself around, or change how those
services are provided.

Change-Id: Ie36665b353cf9788968f253cf281a854a6eff4f4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22107
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2019-10-13 22:02:35 -07:00
parent fea2af5b9c
commit c73c19effd
8 changed files with 43 additions and 26 deletions

View File

@@ -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);
}