From ea267682e6936ce1a6cfb8edd42bab8676a8a649 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 14 Oct 2019 17:51:15 -0700 Subject: cpu: Get rid of the nextInstEventCount method. This was only used by the KVM CPU, and it has access to all it needs to figure out that value locally without requiring all the ThreadContexts to implement an equivalent function. Change-Id: I17a14ce669db2519edf129db761ebd8dc3bd4129 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22114 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/cpu/kvm/base.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/cpu/kvm') diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc index 2522eeeb2..83cb04f47 100644 --- a/src/cpu/kvm/base.cc +++ b/src/cpu/kvm/base.cc @@ -630,7 +630,9 @@ BaseKvmCPU::tick() case RunningServiceCompletion: case Running: { - const uint64_t nextInstEvent(tc->nextInstEventCount()); + auto &queue = thread->comInstEventQueue; + const uint64_t nextInstEvent( + queue.empty() ? MaxTick : queue.nextTick()); // Enter into KVM and complete pending IO instructions if we // have an instruction event pending. const Tick ticksToExecute( @@ -686,7 +688,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(). - thread->comInstEventQueue.serviceEvents(ctrInsts); + queue.serviceEvents(ctrInsts); if (tryDrain()) _status = Idle; @@ -1346,10 +1348,10 @@ BaseKvmCPU::ioctlRun() void BaseKvmCPU::setupInstStop() { - Tick next = tc->nextInstEventCount(); - if (next == MaxTick) { + if (thread->comInstEventQueue.empty()) { setupInstCounter(0); } else { + Tick next = thread->comInstEventQueue.nextTick(); assert(next > ctrInsts); setupInstCounter(next - ctrInsts); } -- cgit v1.2.3