cpu: Get rid of the serviceInstCountEvents method.

This was useful when transitioning away from the CPU based
comInstEventQueue, but now that objects backing the ThreadContexts have
access to the underlying comInstEventQueue and can manipulate it
directly, they don't need to do so through a generic interface.

Getting rid of this function narrows and simplifies the interface.

Change-Id: I202d466d266551675ef6792d38c658d8a8f1cb8b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22113
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh b/src/arch/arm/fastmodel/iris/thread_context.hh
index 73470c5..ef52143 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.hh
+++ b/src/arch/arm/fastmodel/iris/thread_context.hh
@@ -97,7 +97,6 @@
     bool remove(PCEvent *e) override { return false; }
 
     Tick nextInstEventCount() override { return MaxTick; }
-    void serviceInstCountEvents(Tick count) override {}
     void scheduleInstCountEvent(Event *event, Tick count) override {}
     void descheduleInstCountEvent(Event *event) override {}
     Tick getCurrentInstCount() override;
diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh
index e45de6e..d32e0fa 100644
--- a/src/cpu/checker/thread_context.hh
+++ b/src/cpu/checker/thread_context.hh
@@ -98,11 +98,6 @@
         return actualTC->nextInstEventCount();
     }
     void
-    serviceInstCountEvents(Tick count) override
-    {
-        actualTC->serviceInstCountEvents(count);
-    }
-    void
     scheduleInstCountEvent(Event *event, Tick count) override
     {
         actualTC->scheduleInstCountEvent(event, count);
diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index da3e87e..2522eee 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -686,7 +686,7 @@
           // Service any pending instruction events. The vCPU should
           // have exited in time for the event using the instruction
           // counter configured by setupInstStop().
-          tc->serviceInstCountEvents(ctrInsts);
+          thread->comInstEventQueue.serviceEvents(ctrInsts);
 
           if (tryDrain())
               _status = Idle;
diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc
index 0e83db3..c9970b3 100644
--- a/src/cpu/minor/execute.cc
+++ b/src/cpu/minor/execute.cc
@@ -870,8 +870,7 @@
         cpu.system->totalNumInsts++;
 
         /* Act on events related to instruction counts */
-        cpu.getContext(inst->id.threadId)->
-            serviceInstCountEvents(thread->numInst);
+        thread->comInstEventQueue.serviceEvents(thread->numInst);
     }
     thread->numOp++;
     thread->numOps++;
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index bb3f0c3..c843db3 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -1521,7 +1521,7 @@
         system->totalNumInsts++;
 
         // Check for instruction-count-based events.
-        thread[tid]->tc->serviceInstCountEvents(thread[tid]->numInst);
+        thread[tid]->comInstEventQueue.serviceEvents(thread[tid]->numInst);
     }
     thread[tid]->numOp++;
     thread[tid]->numOps++;
diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh
index e195935..6549642 100644
--- a/src/cpu/o3/thread_context.hh
+++ b/src/cpu/o3/thread_context.hh
@@ -93,11 +93,6 @@
             MaxTick : thread->comInstEventQueue.nextTick();
     }
     void
-    serviceInstCountEvents(Tick count) override
-    {
-        thread->comInstEventQueue.serviceEvents(count);
-    }
-    void
     scheduleInstCountEvent(Event *event, Tick count) override
     {
         thread->comInstEventQueue.schedule(event, count);
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index f45165b..3000fae 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -500,7 +500,7 @@
     t_info.setMemAccPredicate(true);
 
     // check for instruction-count-based events
-    thread->getTC()->serviceInstCountEvents(t_info.numInst);
+    thread->comInstEventQueue.serviceEvents(t_info.numInst);
 
     // decode the instruction
     inst = gtoh(inst);
diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh
index 5ed0f29..367ecea 100644
--- a/src/cpu/simple_thread.hh
+++ b/src/cpu/simple_thread.hh
@@ -205,11 +205,6 @@
             MaxTick : comInstEventQueue.nextTick();
     }
     void
-    serviceInstCountEvents(Tick count) override
-    {
-        comInstEventQueue.serviceEvents(count);
-    }
-    void
     scheduleInstCountEvent(Event *event, Tick count) override
     {
         comInstEventQueue.schedule(event, count);
diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh
index 1631064..2e1b572 100644
--- a/src/cpu/thread_context.hh
+++ b/src/cpu/thread_context.hh
@@ -193,7 +193,6 @@
     virtual EndQuiesceEvent *getQuiesceEvent() = 0;
 
     virtual Tick nextInstEventCount() = 0;
-    virtual void serviceInstCountEvents(Tick count) = 0;
     virtual void scheduleInstCountEvent(Event *event, Tick count) = 0;
     virtual void descheduleInstCountEvent(Event *event) = 0;
     virtual Tick getCurrentInstCount() = 0;