40 #include <linux/kvm.h> 41 #include <sys/ioctl.h> 49 #include "arch/utility.hh" 50 #include "debug/Checkpoint.hh" 51 #include "debug/Drain.hh" 52 #include "debug/Kvm.hh" 53 #include "debug/KvmIO.hh" 54 #include "debug/KvmRun.hh" 55 #include "params/BaseKvmCPU.hh" 60 #define PAGE_SIZE pageSize 66 dataPort(
name() +
".dcache_port", this),
67 instPort(
name() +
".icache_port", this),
68 alwaysSyncTC(params->alwaysSyncTC),
69 threadContextDirty(true),
71 vcpuID(
vm.allocVCPUID()), vcpuFD(-1), vcpuMMapSize(0),
72 _kvmRun(NULL), mmioRing(NULL),
73 pageSize(sysconf(_SC_PAGE_SIZE)),
74 tickEvent([this]{
tick(); },
"BaseKvmCPU tick",
82 panic(
"KVM: Failed to determine host page size (%i)\n",
111 fatal(
"KVM: Multithreading not supported");
119 const BaseKvmCPUParams *
const p(
120 dynamic_cast<const BaseKvmCPUParams *>(
params()));
139 PROT_READ | PROT_WRITE, MAP_SHARED,
142 panic(
"KVM: Failed to map run data structure\n");
148 if (!p->useCoalescedMMIO) {
149 inform(
"KVM: Coalesced MMIO disabled by config.\n");
150 }
else if (mmioOffset) {
151 inform(
"KVM: Coalesced IO available\n");
152 mmioRing = (
struct kvm_coalesced_mmio_ring *)(
155 inform(
"KVM: Coalesced not supported by host OS\n");
168 return (activeMMIOReqs || pendingMMIOPkts.size())
175 if (cpu->system->isAtomicMode()) {
176 Tick delay = sendAtomic(pkt);
180 if (pendingMMIOPkts.empty() && sendTimingReq(pkt)) {
183 pendingMMIOPkts.push(pkt);
193 DPRINTF(KvmIO,
"KVM: Finished timing request\n");
200 if (!(activeMMIOReqs || pendingMMIOPkts.size())) {
201 DPRINTF(KvmIO,
"KVM: Finished all outstanding timing requests\n");
202 cpu->finishMMIOPending();
210 DPRINTF(KvmIO,
"KVM: Retry for timing request\n");
212 assert(pendingMMIOPkts.size());
217 while (pendingMMIOPkts.size() && sendTimingReq(pendingMMIOPkts.front())) {
218 pendingMMIOPkts.pop();
240 const BaseKvmCPUParams *
const p(
241 dynamic_cast<const BaseKvmCPUParams *>(
params()));
251 if (p->usePerfOverflow)
266 using namespace Stats;
272 .
desc(
"Number of instructions committed")
277 .
desc(
"total number of KVM exits")
282 .
desc(
"number of KVM entries to finalize pending operations")
287 .
desc(
"exits due to signal delivery")
292 .
desc(
"number of VM exits due to memory mapped IO")
297 .
desc(
"number of coalesced memory mapped IO requests")
302 .
desc(
"number of VM exits due to legacy IO")
307 .
desc(
"number of VM exits due to wait for interrupt instructions")
312 .
desc(
"number of interrupts delivered")
317 .
desc(
"number of hypercalls")
325 DPRINTF(Checkpoint,
"KVM: Serializing thread %i:\n", tid);
337 DPRINTF(Checkpoint,
"KVM: Unserialize thread %i:\n", tid);
351 DPRINTF(Drain,
"BaseKvmCPU::drain\n");
395 DPRINTF(Drain,
"KVM CPU is waiting for service completion, " 396 "requesting drain.\n");
401 DPRINTF(Drain,
"KVM CPU is waiting for timing accesses to complete, " 402 "requesting drain.\n");
407 DPRINTF(Drain,
"KVM CPU is waiting for service, requesting drain.\n");
411 panic(
"KVM: Unhandled CPU state in drain()\n");
449 warn(
"kvm CPU: notifyFork failed to close vcpuFD\n");
502 fatal(
"The KVM-based CPUs requires the memory system to be in the " 503 "'noncaching' mode.\n");
528 DPRINTF(
Kvm,
"ActivateContext %d\n", thread_num);
530 assert(thread_num == 0);
546 DPRINTF(
Kvm,
"SuspendContext %d\n", thread_num);
548 assert(thread_num == 0);
599 hack_once(
"Pretending totalOps is equivalent to totalInsts()\n");
606 inform(
"State dumping not implemented.");
627 const uint64_t nextInstEvent(
628 queue.empty() ?
MaxTick : queue.nextTick());
631 const Tick ticksToExecute(
644 if (ticksToExecute > 0)
647 DPRINTF(KvmRun,
"Entering KVM...\n");
655 delay =
kvmRun(ticksToExecute);
674 if (
_kvmRun->exit_reason != KVM_EXIT_INTR) {
691 panic(
"BaseKvmCPU entered tick() in an illegal state (%i)\n",
725 "Trying to run a KVM CPU in a forked child process. " 726 "This is not supported.\n");
727 DPRINTF(KvmRun,
"KVM: Executing for %i ticks\n", ticks);
733 DPRINTF(KvmRun,
"KVM: Delivering IO without full guest entry\n");
764 if (ticks < runTimer->resolution()) {
765 DPRINTF(KvmRun,
"KVM: Adjusting tick count (%i -> %i)\n",
796 const uint64_t hostCyclesExecuted(
getHostCycles() - baseCycles);
797 const uint64_t simCyclesExecuted(hostCyclesExecuted *
hostFactor);
799 ticksExecuted =
runTimer->ticksFromHostCycles(hostCyclesExecuted);
808 "KVM: Executed %i instructions in %i cycles " 809 "(%i ticks, sim cycles: %i).\n",
810 instsExecuted, hostCyclesExecuted, ticksExecuted, simCyclesExecuted);
822 if (
ioctl(KVM_NMI) == -1)
823 panic(
"KVM: Failed to deliver NMI to virtual CPU\n");
830 if (
ioctl(KVM_INTERRUPT, (
void *)&interrupt) == -1)
831 panic(
"KVM: Failed to deliver interrupt to virtual CPU\n");
837 if (
ioctl(KVM_GET_REGS, ®s) == -1)
838 panic(
"KVM: Failed to get guest registers\n");
844 if (
ioctl(KVM_SET_REGS, (
void *)®s) == -1)
845 panic(
"KVM: Failed to set guest registers\n");
851 if (
ioctl(KVM_GET_SREGS, ®s) == -1)
852 panic(
"KVM: Failed to get guest special registers\n");
858 if (
ioctl(KVM_SET_SREGS, (
void *)®s) == -1)
859 panic(
"KVM: Failed to set guest special registers\n");
865 if (
ioctl(KVM_GET_FPU, &state) == -1)
866 panic(
"KVM: Failed to get guest FPU state\n");
872 if (
ioctl(KVM_SET_FPU, (
void *)&state) == -1)
873 panic(
"KVM: Failed to set guest FPU state\n");
880 #ifdef KVM_SET_ONE_REG 881 struct kvm_one_reg reg;
883 reg.addr = (uint64_t)addr;
885 if (
ioctl(KVM_SET_ONE_REG, ®) == -1) {
886 panic(
"KVM: Failed to set register (0x%x) value (errno: %i)\n",
890 panic(
"KVM_SET_ONE_REG is unsupported on this platform.\n");
897 #ifdef KVM_GET_ONE_REG 898 struct kvm_one_reg reg;
900 reg.addr = (uint64_t)addr;
902 if (
ioctl(KVM_GET_ONE_REG, ®) == -1) {
903 panic(
"KVM: Failed to get register (0x%x) value (errno: %i)\n",
907 panic(
"KVM_GET_ONE_REG is unsupported on this platform.\n");
914 #ifdef KVM_GET_ONE_REG 915 std::ostringstream
ss;
917 ss.setf(std::ios::hex, std::ios::basefield);
918 ss.setf(std::ios::showbase);
919 #define HANDLE_INTTYPE(len) \ 920 case KVM_REG_SIZE_U ## len: { \ 921 uint ## len ## _t value; \ 922 getOneReg(id, &value); \ 926 #define HANDLE_ARRAY(len) \ 927 case KVM_REG_SIZE_U ## len: { \ 928 uint8_t value[len / 8]; \ 929 getOneReg(id, value); \ 930 ccprintf(ss, "[0x%x", value[0]); \ 931 for (int i = 1; i < len / 8; ++i) \ 932 ccprintf(ss, ", 0x%x", value[i]); \ 936 switch (
id & KVM_REG_SIZE_MASK) {
949 #undef HANDLE_INTTYPE 954 panic(
"KVM_GET_ONE_REG is unsupported on this platform.\n");
985 DPRINTF(KvmRun,
"handleKvmExit (exit_reason: %i)\n",
_kvmRun->exit_reason);
991 switch (
_kvmRun->exit_reason) {
992 case KVM_EXIT_UNKNOWN:
995 case KVM_EXIT_EXCEPTION:
1006 case KVM_EXIT_HYPERCALL:
1024 DPRINTF(KvmIO,
"KVM: Handling MMIO (w: %u, addr: 0x%x, len: %u)\n",
1038 case KVM_EXIT_IRQ_WINDOW_OPEN:
1041 case KVM_EXIT_FAIL_ENTRY:
1049 case KVM_EXIT_INTERNAL_ERROR:
1050 panic(
"KVM: Internal error (suberror: %u)\n",
1055 panic(
"KVM: Unexpected exit (exit_reason: %u)\n",
_kvmRun->exit_reason);
1062 panic(
"KVM: Unhandled guest IO (dir: %i, size: %i, port: 0x%x, count: %i)\n",
1070 panic(
"KVM: Unhandled hypercall\n");
1076 warn(
"KVM: Unhandled IRQ window.\n");
1085 panic(
"KVM: Unknown error when starting vCPU (hw reason: 0x%llx)\n",
1086 _kvmRun->hw.hardware_exit_reason);
1093 panic(
"KVM: Got exception when starting vCPU " 1094 "(exception: %u, error_code: %u)\n",
1102 panic(
"KVM: Failed to enter virtualized mode (hw reason: 0x%llx)\n",
1103 _kvmRun->fail_entry.hardware_entry_failure_reason);
1112 RequestPtr mmio_req = std::make_shared<Request>(
1123 warn(
"Finalization of MMIO address failed: %s\n", fault->name());
1130 if (mmio_req->isLocalAccess()) {
1134 const Cycles ipr_delay = mmio_req->localAccessor(
tc, pkt);
1150 std::unique_ptr<struct kvm_signal_mask> kvm_mask;
1153 kvm_mask.reset((
struct kvm_signal_mask *)
operator new(
1154 sizeof(
struct kvm_signal_mask) +
sizeof(*mask)));
1158 assert(
sizeof(*mask) >= 8);
1160 memcpy(kvm_mask->sigset, mask, kvm_mask->len);
1163 if (
ioctl(KVM_SET_SIGNAL_MASK, (
void *)kvm_mask.get()) == -1)
1164 panic(
"KVM: Failed to set vCPU signal mask (errno: %i)\n",
1172 panic(
"KVM: CPU ioctl called before initialization\n");
1174 return ::ioctl(
vcpuFD, request, p1);
1183 DPRINTF(KvmIO,
"KVM: Flushing the coalesced MMIO ring buffer\n");
1189 struct kvm_coalesced_mmio &ent(
1192 DPRINTF(KvmIO,
"KVM: Handling coalesced MMIO (addr: 0x%x, len: %u)\n",
1193 ent.phys_addr, ent.len);
1196 ticks +=
doMMIOAccess(ent.phys_addr, ent.data, ent.len,
true);
1222 struct sigaction sa;
1224 memset(&sa, 0,
sizeof(sa));
1226 sa.sa_flags = SA_SIGINFO | SA_RESTART;
1228 panic(
"KVM: Failed to setup vCPU timer signal handler\n");
1231 if (pthread_sigmask(SIG_BLOCK, NULL, &sigset) == -1)
1232 panic(
"KVM: Failed get signal mask\n");
1244 if (pthread_sigmask(SIG_SETMASK, &sigset, NULL) == -1)
1245 panic(
"KVM: Failed mask the KVM control signals\n");
1251 int discardedSignal;
1255 struct timespec timeout;
1257 timeout.tv_nsec = 0;
1260 sigemptyset(&sigset);
1261 sigaddset(&sigset, signum);
1264 discardedSignal = sigtimedwait(&sigset, NULL, &timeout);
1265 }
while (discardedSignal == -1 && errno == EINTR);
1267 if (discardedSignal == signum)
1269 else if (discardedSignal == -1 && errno == EAGAIN)
1272 panic(
"Unexpected return value from sigtimedwait: %i (errno: %i)\n",
1273 discardedSignal, errno);
1279 DPRINTF(
Kvm,
"Attaching cycle counter...\n");
1281 PERF_COUNT_HW_CPU_CYCLES);
1314 DPRINTF(Drain,
"tryDrain: Architecture code is not ready.\n");
1320 "tryDrain: CPU transitioned into the Idle state, drain done\n");
1324 DPRINTF(Drain,
"tryDrain: CPU not ready.\n");
1332 if (
ioctl(KVM_RUN) == -1) {
1334 panic(
"KVM: Failed to start virtual CPU (errno: %i)\n",
1360 PERF_COUNT_HW_INSTRUCTIONS);
#define panic(...)
This implements a cprintf based panic() function.
void detach()
Detach a counter from PerfEvent.
void tick()
Execute the CPU until the next event in the main event queue or until the guest needs service from ge...
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void setupCounters()
Setup hardware performance counters.
EventQueue * deviceEventQueue()
Get a pointer to the event queue owning devices.
PerfKvmCounterConfig & pinned(bool val)
Force the group to be on the active all the time (i.e., disallow multiplexing).
void finishMMIOPending()
Callback from KvmCPUPort to transition the CPU out of RunningMMIOPending when all timing requests hav...
Counter ctrInsts
Number of instructions executed by the CPU.
void suspend() override
Set the status to Suspended.
Status status() const override
decltype(nullptr) constexpr NoFault
Cycles is a wrapper class for representing cycle counts, i.e.
#define fatal(...)
This implements a cprintf based fatal() function.
uint64_t activeInstPeriod
Currently active instruction count breakpoint.
Timing MMIO request in flight or stalled.
Tick lastActivate
Last time activate was called on this thread.
const std::string & name()
bool empty() const
Returns true if no events are queued.
virtual void updateThreadContext()=0
Update the current thread context with the KVM state.
virtual Tick handleKvmExitIO()
The guest performed a legacy IO request (out/inp on x86)
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Tick submitIO(PacketPtr pkt)
Interface to send Atomic or Timing IO request.
virtual BaseTLB * getDTBPtr()=0
bool threadContextDirty
Is the gem5 context dirty? Set to true to force an update of the KVM vCPU state upon the next call to...
bool perfControlledByTimer
Does the runTimer control the performance counters?
void getSpecialRegisters(struct kvm_sregs ®s) const
void notifyFork() override
Notify a child process of a fork.
std::shared_ptr< Request > RequestPtr
virtual Tick kvmRun(Tick ticks)
Request KVM to run the guest for a given number of ticks.
void cpuStartup()
VM CPU initialization code.
Tick lastSuspend
Last time suspend was called on this thread.
std::unique_ptr< BaseKvmTimer > runTimer
Timer used to force execution into the monitor after a specified number of simulation tick equivalent...
ThreadContext * tc
ThreadContext object, provides an interface for external objects to modify this thread's state...
void kvmNonMaskableInterrupt()
Send a non-maskable interrupt to the guest.
void enableSignals(pid_t tid, int signal)
Enable signal delivery to a thread on counter overflow.
virtual Tick handleKvmExitIRQWindowOpen()
The guest exited because an interrupt window was requested.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
bool switchedOut() const
Determine if the CPU is switched out.
void wakeup(ThreadID tid=0) override
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
void setStatus(Status newStatus) override
virtual void dump() const
Dump the internal state to the terminal.
float hostFactor
Host factor as specified in the configuration.
bool tryDrain()
Try to drain the CPU if a drain is pending.
void getFPUState(struct kvm_fpu &state) const
Get/Set the guest FPU/vector state.
Counter totalInsts() const override
Stats::Scalar numExitSignal
virtual Tick kvmRunDrain()
Request the CPU to run until draining completes.
int createVCPU(long vcpuID)
Create a new vCPU within a VM.
Tick flushCoalescedMMIO()
Service MMIO requests in the mmioRing.
DrainState drain() override
Notify an object that it needs to drain its state.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
The request is to an uncacheable address.
DrainState
Object drain/handover states.
const long vcpuID
KVM internal ID of the vCPU.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
virtual void updateKvmState()=0
Update the KVM state from the current thread context.
void regStats() override
Callback to set stat parameters.
void regStats() override
Callback to set stat parameters.
DrainState drainState() const
Return the current drain state of an object.
void activateContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now active.
Stats::Scalar numInterrupts
std::vector< ThreadContext * > threadContexts
#define KVM_KICK_SIGNAL
Signal to use to trigger exits from KVM.
PerfKvmCounterConfig & wakeupEvents(uint32_t events)
Set the number of samples that need to be triggered before reporting data as being available on the p...
void setSpecialRegisters(const struct kvm_sregs ®s)
Draining buffers pending serialization/handover.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
void setupSignalHandler()
Setup a signal handler to catch the timer signal used to switch back to the monitor.
Tick curTick()
The current simulated tick.
Temporarily migrate execution to a different event queue.
int vcpuMMapSize
Size of MMAPed kvm_run area.
virtual Tick handleKvmExitFailEntry()
KVM failed to start the virtualized CPU.
void drainResume() override
Resume execution after a successful drain.
struct kvm_run * _kvmRun
Pointer to the kvm_run structure used to communicate parameters with KVM.
void syncKvmState()
Update the KVM if the thread context is dirty.
void activate() override
Set the status to Active.
virtual void takeOverFrom(BaseCPU *cpu)
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
ThreadContext * getContext(int tn) override
Given a thread num get tho thread context for it.
MasterID dataMasterId() const
Reads this CPU's unique data requestor ID.
void setOneReg(uint64_t id, const void *addr)
Get/Set single register using the KVM_(SET|GET)_ONE_REG API.
uint64_t Tick
Tick count type.
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
virtual bool archIsDrained() const
Is the architecture specific code in a state that prevents draining?
const bool alwaysSyncTC
Be conservative and always synchronize the thread context on KVM entry/exit.
void deallocateContext(ThreadID thread_num)
void takeOverFrom(BaseCPU *cpu) override
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
struct kvm_coalesced_mmio_ring * mmioRing
Coalesced MMIO ring buffer.
void startup() override
startup() is the final initialization call before simulation.
std::string getAndFormatOneReg(uint64_t id) const
Get and format one register for printout.
EventQueue * curEventQueue()
void getRegisters(struct kvm_regs ®s) const
Get/Set the register state of the guest vCPU.
pthread_t vcpuThread
ID of the vCPU thread.
void deschedule(Event &event)
PerfKvmCounterConfig & samplePeriod(uint64_t period)
Set the initial sample period (overflow count) of an event.
bool attached() const
Check if a counter is attached.
bool kvmStateDirty
Is the KVM state dirty? Set to true to force an update of the KVM vCPU state upon the next call to kv...
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
PerfKvmCounter hwInstructions
Guest instruction counter.
uint64_t read() const
Read the current value of a counter.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
PerfKvmCounter hwCycles
Guest cycle counter.
Service completion in progress.
void schedule(Event &event, Tick when)
EventFunctionWrapper tickEvent
Requiring service at the beginning of the next cycle.
virtual Tick handleKvmExitException()
An unhandled virtualization exception occured.
void setSignalMask(const sigset_t *mask)
Set the signal mask used in kvmRun()
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
Stats::Scalar numVMHalfEntries
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
void attach(PerfKvmCounterConfig &config, pid_t tid)
Attach a counter.
int64_t Counter
Statistics counter type.
void setupInstStop()
Setup an instruction break if there is one pending.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Status _status
CPU run state.
bool discardPendingSignal(int signum) const
Discard a (potentially) pending signal.
virtual Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const =0
Do post-translation physical address finalization.
virtual void switchOut()
Prepare for another CPU to take over execution.
void kvmInterrupt(const struct kvm_interrupt &interrupt)
Send a normal interrupt to the guest.
Stats::Scalar numHypercalls
BaseKvmCPU(BaseKvmCPUParams *params)
void setFPUState(const struct kvm_fpu &state)
PerfKvmCounterConfig & exclude_host(bool val)
Exclude the events from the host (i.e., only include events from the guest system).
bool scheduled() const
Determine if the current event is scheduled.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
int16_t ThreadID
Thread index/ID type.
virtual const std::string name() const
const long pageSize
Cached page size of the host.
PerfKvmCounterConfig & disabled(bool val)
Don't start the performance counter automatically when attaching it.
static void onKickSignal(int signo, siginfo_t *si, void *data)
Dummy handler for KVM kick signals.
PerfKvmCounterConfig & exclude_hv(bool val)
Exclude the hyper visor (i.e., only include events from the guest system).
Cycles ticksToCycles(Tick t) const
KVMCpuPort dataPort
Port for data requests.
void ioctlRun()
Execute the KVM_RUN ioctl.
std::ostream CheckpointOut
Status nextIOState() const
Returns next valid state after one or more IO accesses.
void getOneReg(uint64_t id, void *addr) const
PerfEvent counter configuration.
int vcpuFD
KVM vCPU file descriptor.
virtual uint64_t getHostCycles() const
Get the value of the hardware cycle counter in the guest.
void setRegisters(const struct kvm_regs ®s)
bool bypassCaches() const
Should caches be bypassed?
EventQueue * eventQueue() const
void setupInstCounter(uint64_t period=0)
Setup the guest instruction counter.
void signalDrainDone() const
Signal that an object is drained.
void stop()
Stop counting.
void suspendContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now suspended.
virtual Tick handleKvmExitHypercall()
The guest requested a monitor service using a hypercall.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual ContextID contextId() const =0
int ioctl(int request, long p1) const
vCPU ioctl interface.
virtual Status status() const =0
int capCoalescedMMIO() const
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in...
Kvm * kvm
Global KVM interface.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Context not scheduled in KVM.
void startup() override
startup() is the final initialization call before simulation.
Counter totalOps() const override
virtual Tick handleKvmExitUnknown()
An unknown architecture dependent error occurred when starting the vCPU.
SimpleThread * thread
A cached copy of a thread's state in the form of a SimpleThread object.
void start()
Start counting.
Temporarily release the event queue service lock.
void switchOut() override
Prepare for another CPU to take over execution.
EventQueue comInstEventQueue
An instruction-based event queue.
int getVCPUMMapSize() const
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and ...
virtual void initMemProxies(ThreadContext *tc)=0
Initialise the physical and virtual port proxies and tie them to the data port of the CPU...
virtual Tick handleKvmExit()
Main kvmRun exit handler, calls the relevant handleKvmExit* depending on exit type.
std::shared_ptr< FaultBase > Fault
const Params * params() const
Tick doMMIOAccess(Addr paddr, void *data, int size, bool write)
Inject a memory mapped IO request into gem5.
Timer based on standard POSIX timers.
Stats::Scalar numCoalescedMMIO
PerfEvent based timer using the host's CPU cycle counter.
void kick() const
Force an exit from KVM.
void startupThread()
Thread-specific initialization.
void syncThreadContext()
Update a thread context if the KVM state is dirty with respect to the cached thread context...
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
ProbePointArg< PacketInfo > Packet
Packet probe point.