bool schedule(PCEvent *e) override { return false; }
bool remove(PCEvent *e) override { return false; }
- Tick nextInstEventCount() override { return MaxTick; }
void scheduleInstCountEvent(Event *event, Tick count) override {}
void descheduleInstCountEvent(Event *event) override {}
Tick getCurrentInstCount() override;
bool schedule(PCEvent *e) override { return actualTC->schedule(e); }
bool remove(PCEvent *e) override { return actualTC->remove(e); }
- Tick
- nextInstEventCount() override
- {
- return actualTC->nextInstEventCount();
- }
void
scheduleInstCountEvent(Event *event, Tick count) override
{
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(
// 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;
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);
}
return thread->pcEventQueue.remove(e);
}
- Tick
- nextInstEventCount() override
- {
- return thread->comInstEventQueue.empty() ?
- MaxTick : thread->comInstEventQueue.nextTick();
- }
void
scheduleInstCountEvent(Event *event, Tick count) override
{
bool schedule(PCEvent *e) override { return pcEventQueue.schedule(e); }
bool remove(PCEvent *e) override { return pcEventQueue.remove(e); }
- Tick
- nextInstEventCount() override
- {
- return comInstEventQueue.empty() ?
- MaxTick : comInstEventQueue.nextTick();
- }
void
scheduleInstCountEvent(Event *event, Tick count) override
{
virtual EndQuiesceEvent *getQuiesceEvent() = 0;
- virtual Tick nextInstEventCount() = 0;
virtual void scheduleInstCountEvent(Event *event, Tick count) = 0;
virtual void descheduleInstCountEvent(Event *event) = 0;
virtual Tick getCurrentInstCount() = 0;